Search code examples
imagemagickimagemagick-convert

imagemagick: how to get image size after resize?


I'm resizing my image using imagemagick, however, I'm not specifying the exact size:

convert $filename -resize 1080000@ -quality 100 $reduced_filename

it's resized within a bound, now the problem is, after resize, the size in the EXIF is no longer correct, and I don't have a clue of calculating the new size (e.g. percentage resize can let me calculate new size based on percentage).

So is there a way to get image size after resizing?

Thanks!


Solution

  • You can use ImageMagick's "convert" command to access the image dimensions with a command like this...

    convert $filename -format "%[w]x%[h]" info: