Reputation: 5341
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!
Upvotes: 0
Views: 2177
Reputation: 207778
Like this...
First create a start image 1024x768:
convert -size 1024x768 xc:black start.jpg
Now resize, and output new size info in one fell swoop:
convert start.jpg -resize 50% -format "%wx%h" -write info: result.jpg
512x384
Upvotes: 3
Reputation: 5395
You can use ImageMagick's "convert" command to access the image dimensions with a command like this...
convert $filename -format "%[w]x%[h]" info:
Upvotes: 3