-
Notifications
You must be signed in to change notification settings - Fork 46
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
Is it possible to use this to crop to center and retain aspect ratio? #21
Comments
Short answer is yes. We use epeg for exactly that purpose. I can't give you the long answer at the moment since I'm on vacation but epeg can certainly do what you asked. |
Actually, thinking about this some more, perhaps we had to add one extra step of our own to add letterboxing when necessary after epeg created the thumbnails. Sorry for the lack of specificity at the moment. |
@Adam-VisualVocal would it be possible for you to post the long answer? I'm struggling to solve this exact problem. |
This is how we do it.
This will give you a thumbnail with the same aspect ratio as the original source image whose width and height are no larger than If you want your thumbnail file to be padded with blank pixels to make it square then you'll have to add a few extra steps. For example, replace the last two steps with a call to |
I've got an input of files of various sizes, i want to create square thumbnails of all of them but retain aspect ratio and crop when necessary. Is this possible with epeg?
The text was updated successfully, but these errors were encountered: