Comment 7 for bug 1842116

Revision history for this message
Akkana Peck (akkzilla) wrote :

Interesting. But my images still have the Orientation tag, as shown by the jhead | egrep commands I listed. So maybe imagemagick and graphicsmagick (I tried both, same result) are writing the Orientation tag in the wrong place, and if jpegexiforient isn't going to be fixed, maybe I should be filing bugs on both imagemagick and graphicsmagick?

I'm also a bit curious why this only appeared recently. I've been using convert and exifautotran for many years, and they've worked fine together in the past. Since that Debian bug is from December 2019, maybe exifautotran only recently started enforcing this requirement.

If I understand https://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_JPEG_files,
SOI should be 0xFF, 0xD8 and APP1 should be 0xFF, 0xEn. The beginning of one of my scaled files in hexdump is:
0000000 d8ff e0ff 1000 464a 4649 0100 0101 5e01
0000010 5e01 0000 e1ff cbbb 7845 6669 0000 4949
so the d8ff (SOI) is right at the beginning, and the e1ff is in the second line. In the original image from the camera, the first line looks like:
0000000 d8ff e1ff cbbb 7845 6669 0000 4949 002a
so indeed, APP1 is right after the SOI.

That page also says:
In theory, Exif APP1 is recorded immediately after the SOI marker (the marker indicating the beginning of the file). However, this leads to the incompatibility between the Exif and JFIF standards because both of them specify that their particular application segment (APP0 for JFIF, APP1 for Exif) must be the first in the image file. In practice, most JPEG files contain a JFIF marker segment (APP0) that precedes the Exif APP1. This allows older readers to correctly handle the format JFIF segment, while newer readers also decode the following Exif segment, being less strict about requiring it to appear first. This way will not affect the image decoding for most decoders, but poorly designed JFIF or Exif parsers may not recognize the file properly.

But presumably the Debian libjpeg-turbo-progs maintainer would disagree. Sigh. I'll file imagemagick and graphicsmagick bugs.