imagemagickimagemagick-identify

ImageMagick: get image size with respect to EXIF orientation


I know that convert can use -auto-orient parameter to correctly rotate image when resizing it but can I somehow get image's rotated size with respect to EXIF orientation using identify?


Solution

  • The -auto-orient option is not supported by identify so you will have to use the convert command. With the code below you can get the dimensions of your image:

    // If you only need the width and height
    convert -auto-orient image.jpg -format %wx%h info:
    
    // If you want the same result as identify
    convert -auto-orient image.jpg info: