Is there a way to supply original width/height (not an image, just 2 numbers) to convert or identify command, and receive a resulting width/height based on a geometry, as if an actual image was resized? For example: I would supply 1000,600 (w/h) and geometry '600x600>' and I should get 600,360 on output. If I supply 500,400 with the same geometry, I would get 500,400 on output (since I used ">", which does shrink-only).
In my imagination it would look something like this:
Code: Select all
$ identify -calc -width 1000 -height 600 -geometry 600x600> -format "%wx%h"
600x360
This is useful for me because the images are uploaded to S3, and I don't want to download them in order to find out the final sizes, or having to store those sizes in the database for every thumbnail. I also wouldn't want to have to reimplement all the geometry logic in my programming language of choice, if I could simply call imagemagick to do the native calculation.