1

I want to know what does following Imagemagick command exactly does:

convert input.jpg -auto-orient out.jpg

Does it just read and update exif ? Or does it also rotate the pixels present in the image?

fmw42
  • 46,825
  • 10
  • 62
  • 80

1 Answers1

1

Taking a vertical picture from my camera (orientation in Exif data):

  • IM identify says:

    Test.jpg JPEG 5472x3648 5472x3648+0+0 8-bit sRGB 6.907MB 0.000u 0:00.000
    
  • The Linux file command says (extracts):

    Test.jpg: JPEG image data, Exif standard: [... orientation=lower-left, ... ], ... , 5472x3648, ...
    

After conversion,

  • IM identify says:

    Test-out.jpg JPEG 3648x5472 3648x5472+0+0 8-bit sRGB 7.082MB 0.000u 0:00.010
    
  • And file:

    Test-out.jpg: JPEG image data, Exif Standard: [...  orientation=upper-left, ...], ... , 3648x5472, ...
    

So obviously the JPEG is rewritten to have the usual orientation and be compatible with JPEG readers that don't hanfdle the EXIF orientation.

xenoid
  • 8,396
  • 3
  • 23
  • 49