Orientation tag vs. Auto Rotate tag

Started by TomD, June 16, 2024, 07:31:59 PM

Previous topic - Next topic

TomD

Hi guys, this one has me completely stumped.  Not necessarily an exiftool issue, but given the expertise here, I'm hoping someone has insights regarding the auto-rotate tag.  Never heard of this tag before and a quick google search doesn't produce any relevant hits.  I also couldn't find anything in the exiftool documentation but perhaps I'm not looking in the right place.

Here is a sample image: https://live.staticflickr.com/2410/2465156365_3a80312185_o.jpg

This image has both "Orientation" and "Auto Rotate" tags in the metadata.  Exiftool reports the Orientation tag is 1 (normal) and the Auto Rotate tag is 8 (rotate 270).  Downloading the image, it doesn't orient properly on my computer, but curiously enough, if you click on the link above to view the image in a modern browser, it will orient properly using the Auto Rotate tag.

I stumbled onto this image as it wouldn't thumbnail properly in imagemagick.  After pulling my hair out trying to figure out why, I found that after processing the image in imagemagick, the browser no longer respects Auto Rotate tag.  You can see this if you download the image, and upload it to the imagemagick playground here: https://cancerberosgx.github.io/magic/playground/index.html (make no adjustments to the image, just convert input.jpg output.jpg and it will no longer orient properly in the browser).

I decided to download the image produced by imagemagick to compare the metadata in exiftool.  exiftool reports the only change is the imagemagick output ncludes "JFIF Version: 1.01".

StarGeek

This is FAQ #3.

If you use that command, it will show you that this tag is a Canon MakerNotes tag (see Canon ShotInfo Tags).
C:\>exiftool -G1 -a -s -AutoRotate Y:\!temp\x\2465156365_3a80312185_o.jpg
[Canon]         AutoRotate                      : Rotate 270 CW

Additionally, using that command, you would see that it has two EXIF:Orientation tags
C:\>exiftool -G1 -a -s -orientation Y:\!temp\x\2465156365_3a80312185_o.jpg
[IFD0]          Orientation                     : Horizontal (normal)
[IFD0]          Orientation                     : Rotate 270 CW

C:\>exiftool -g1 -a -s -warning -validate Y:\!temp\x\2465156365_3a80312185_o.jpg
---- ExifTool ----
Warning                         : Entries in IFD0 are out of order
Warning                         : Duplicate tag 0x0112 Orientation in IFD0
Warning                         : [minor] Adjusted MakerNotes base by 46
Validate                        : 3 Warnings (1 minor)

The Canon:AutoRotate can be ignored. MakerNotes tags usually aren't read by any programs except camera specific ones, i.e. Canon software in this case. The programs that are rotating the image correctly are reading the second, correct Orientation tag.

While it is possible that the image came from the camera with two Orientation tags, camera manufacturers are not the best at following the specs, I would more likely place blame on the program that edited it afterwards.
C:\>exiftool -G1 -a -s -Software Y:\!temp\x\2465156365_3a80312185_o.jpg
[IFD0]          Software                        : QuickTime 7.4.5
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

TomD

OK great, thanks, seems it had nothing to do with the maker tag, just dual tags.