On Sunday 18 November 2007 6:30:30 pm Steven Woody wrote:
> hi,
>
> i want to resize batch of pictures to a smaller size.  the
> rule is every picture's longer edge should be reduce to 800
> pixels, and the another edge keep the aspect ratio.  how can i
> do this using `convert' command?  i found the problem is how
> to get know what ( W or H ) is the image's longer edge.

Assuming you are using a shell like bash:

You can use: 
width=$(identify -format '%w' filename) to get the width and
height=$(identify -format '%h' filename) to get the height

You can use an if test to figure out which side to scale and
scale the image with:
convert -scale x800 filename to scale on the vertical side and
convert -scale 800 filename to scale on the horizontal side
-- 
Scott
Linux user #: 246504
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to