How can I display the orientation of a JPEG file?

后端 未结 2 1740
一个人的身影
一个人的身影 2020-12-09 03:34

What ImageMagick command will display the orientation of a JPG file?

2条回答
  •  一生所求
    2020-12-09 04:04

    You can use

    identify -format '%[EXIF:Orientation]' 
    

    as per identify -format docs (It's the bit further down about exif metadata).

    Try

    identify -verbose 
    

    To see what metadata is in the image (for example if the image was not taken with a camera, the orientation tag will not be set).

    Alternatively you could do something like

    identify -format '%wx%h' 
    

    which gives you the width by height (e.g. '800x598', '1936x2592') and use these to determine whether the image is upright or not (not sure how reliable this is though - sometimes you take a portrait image with a camera and the EXIF data will correctly record the orientation, but the image may still appear landscape).

提交回复
热议问题