ImageMagick - how to enforce min/max heights/widths?
Posted
by Henryh
on Stack Overflow
See other posts from Stack Overflow
or by Henryh
Published on 2010-05-06T16:07:51Z
Indexed on
2010/05/06
17:08 UTC
Read the original article
Hit count: 284
Using ImageMagick, how can I resize an image to have a minimum:
- height of 150px
- width of 200px
and also have a maximum:
- height of 225px
- width of 275px
UPDATE:
In case it helps, here's a further explanation of what I'm experiencing.
I have a buch of images with all different ratio dimensions. Some images have 1:5 height/width ratios. Some have 5:1 height/width ratios. So that I want to do is set that a minimum height/width size for the image but also don't want the image size to be larger than a particular size.
If I need to apply white padding to an image to make it fit within my constraint so that I don't have to distort the image, I'd like to do so.
© Stack Overflow or respective owner