[prev in list] [next in list] [prev in thread] [next in thread]
List: imagemagick-user
Subject: Re: [magick-users] resize based on the longer dimension
From: Scott <scotbicknel () cox ! net>
Date: 2007-11-19 3:27:56
Message-ID: 200711181927.56365.scotbicknel () cox ! net
[Download RAW message or body]
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
Magick-users@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic