PNG eXIf chunk location before IDAT for web browsers

Started by garpin, July 01, 2021, 04:58:45 AM

Previous topic - Next topic

garpin

Hi!

I added orientation data to a PNG file using ExifTool 12.28 on Linux with this command:

exiftool -Orientation=6 -n image.png

It seems that ExifTool adds the eXIf chunk after the IDAT image data.

Web Browser vendors have decided that the eXIf chunk needs to be before image data, otherwise web browsers will ignore it: https://github.com/w3c/csswg-drafts/issues/4929

It would be great if the exiftool was changed so that the eXIf chunk is written before the IDAT image data so that web browsers will be able to use it.

Also, macOS 11.4 Preview App seems to expect the eXIf chunk to be before IDAT, otherwise it doesn't recognize it.

Thanks!

System type: Linux
ExifTool version: 12.28
Command line: exiftool -Orientation=6 -n image.png



Phil Harvey

I just love the way that specifications mean nothing.

OK, thanks.  I'll look into this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

ExifTool 12.29 (just released) writes PNG eXIf before the IDAT chunk.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

garpin

Thank you for changing it! I tried ExifTool 12.29. PNG images with exif data are now properly recognized by Mac Preview and Safari. Great!