Hi,
I would like to be able to use orientation dependent resizing. Since I don't know the widht x height of the image I'm feeding to ImageMagick, I would like ImageMagick to figure out the orientation and resize proportionally based on a max width of X in landscape and max height of Y in portrait.
Does anyone know how to do this?
Kind regards,
Marc
Orientation dependent resizing
Re: Orientation dependent resizing
Check out: http://www.imagemagick.org/script/comma ... php#resize
and : http://www.imagemagick.org/script/comma ... p#geometry
I think you want the standard -resize widthxheight without any options.
and : http://www.imagemagick.org/script/comma ... p#geometry
I think you want the standard -resize widthxheight without any options.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Orientation dependent resizing
Basically the default operation is to resize an image so it fits into the bound given as the resize argument, while preserving the images aspect ratio. Generally it means only one of the dimensions of the resulting image will match the dimension given.
Their are options (flags) that will make turn of aspect preservation, and force the image to become the size given exactly
or to make the image size so it the given dimensions just fits inside the result (minimal dimentions made to fit rather than maximum dimension.
See IM Examples Resize
Their are options (flags) that will make turn of aspect preservation, and force the image to become the size given exactly
or to make the image size so it the given dimensions just fits inside the result (minimal dimentions made to fit rather than maximum dimension.
See IM Examples Resize
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Orientation dependent resizing
-resize XxY will always look for the largest size and scale that to eithr XxY depending on whether width or height is larger and keep the aspect ratio. If you want to resize by the smaller dimension, then use the ^ flag. see all the resize options at http://www.imagemagick.org/script/comma ... p#geometry and examples at http://www.imagemagick.org/Usage/resize/#resize
see also my scripts aspect and aspectpad at the links below
see also my scripts aspect and aspectpad at the links below