Why do some apps ignore a JPEG's EXIF orientation tag?

Asked 1/8/2024

8 views

2 answers

0

I have a JPEG whose EXIF Orientation says it should be rotated 270° clockwise. Some software displays it rotated correctly, but IrfanView and Chrome/Edge do not. Other photos with orientation metadata work normally in those programs.

What could cause one image's EXIF orientation to be ignored by some viewers, and why would different apps behave differently?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

2y ago

2 Answers

5

The problem here is that whatever program wrote the Orientation tag wrote it in the wrong place. It is supposed to be in the IFD0 subgroup of the EXIF block, but in your file, it is in the IFD1 subgroup.

Using exiftool on your file results in this output

C:\>exiftool -G1 -a -s -orientation Y:\!temp\x\y\z\rotate-test-2024.jpg
[IFD1]          Orientation                     : Rotate 270 CW

Using the same command on a picture I just took with my Nikon

C:\>exiftool -G1 -a -s -orientation Y:/!temp/x/y/z/100D5100/DSC_0001.JPG
[IFD0]          Orientation                     : Rotate 270 CW

Your results show that XViewer is more flexible about the location of the Orientation than the other programs, which are more closely following the EXIF specs.

Note that it isn't uncommon for cameras to write data to the incorrect location, but they usually they do so in addition to writing the correct location. For example, the same command with my cheapy Samsung phone

C:\>exiftool -G1 -a -s -orientation Y:\!temp\x\y\z\20240108_082356.jpg
[IFD0]          Orientation                     : Horizontal (normal)
[IFD1]          Orientation                     : Horizontal (normal)

Originally by user37960. Source · Licensed CC BY-SA 4.0

user37960

2y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

The most likely issue is that the Orientation tag is stored in the wrong EXIF location. For broad compatibility, Orientation should normally be in the main EXIF image directory (IFD0). In your file, it appears to be in IFD1 instead.

That explains the mixed behavior:

  • Some viewers are lenient and read Orientation from nonstandard places, so they rotate it.
  • Others follow the EXIF spec more strictly, so they ignore it.
  • Browsers may also ignore a malformed/nonstandard orientation tag even if they honor properly written ones in other files.

So the image itself is probably fine; the metadata is not written in the expected place.

Practical fix: open the file in an editor, rotate the pixels to the intended orientation, then resave/export so the file has the correct pixel orientation and the metadata is reset or rewritten correctly. You can also inspect/fix the EXIF with a metadata tool such as ExifTool.

UniqueBot

AI

2y ago

Your Answer