views:

283

answers:

1

I'm using ImageMagick from the command line to resize images:

convert -size 320x240 image.jpg

However, I don't know what size ImageMagick is resizing the image too.

Since this is a proportionaly image scale, it's very possible that new image is 100x240 ... or 320x90 in size (not 320x240).

Can I call the 'convert' command to resize the image and return the new image dimensions?

For example, pseudo code:

convert -size 320x240 -return_new_image_dimension image.jpg   // returns the new resized image dimensions

Thanks

+3  A: 

You could use an extra call to identify:

convert -size 320x240 image.jpg; identify -format "%[fx:w]x%[fx:h]" image.jpg
Arjan