Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to define aspect ratio instead of exact widths #21

Open
TxHawks opened this issue Mar 27, 2015 · 1 comment
Open

Add option to define aspect ratio instead of exact widths #21

TxHawks opened this issue Mar 27, 2015 · 1 comment

Comments

@TxHawks
Copy link

TxHawks commented Mar 27, 2015

It would be good to have an option to specify an aspect ratio instead of an explicit width and height, and have those be determined by the individual file's dimension.

For instance, If I have a folder with the following image files and dimensions, and I want all of them to end up being resized to a 16:9 format:
a.jpg - 1200px * 800px
b.png - 1920px * 1200px
c.jpg - 200px * 200px
d.jpg - 800px * 400px

I could have them all set to a certain width and height, but that may mean some of them will be inflated, which isn't desirable.

A better option would be add an aspect-ratio option, say 16:9 in this case, and have resizing be based on the image dimensions and specified ratio. With the above files as example, we would end up with the following files in the dist folder:
a.jpg - 1200px*675px
b.png - 1920px * 1080px
c.jpg - 200px * 112px
d.jpg - 711px * 400px

@AndreBaumeier
Copy link

+1 on this
extending to only fill either height or width and resize keeping ratio would be a great option as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants