Re: PNG Loves EXIF

Cosmin Truta <[email protected]> Sun, 17 Jun 2018 23:58:50 -0400
Newsgroups gmane.comp.graphics.png.devel
Message-ID <CAAoVtZyHtqToBWzUM_cf-HTpnc0i5-sicefpJJ3Q3E=H7dH7wg@mail.gmail.com>
On Sat, 16 Jun 2018 at 10:46, Dustin Oprea wrote:
> Thanks, Cosmin. I just did a new release. Try it now.

Looks good!

> I did observe one thing with the libpng implementation: Initially, I used the test image used for the EXIF unit-tests from libpng in my own unit-tests, but I ended-up not being able to. An EXIF IFD block ends in a uint32, which is a pointer to another IFD. This is usually only non-zero for IFD0, where it points to IFD1. Either way, this is required. It is missing from the IFD in the test PNG. I'm guessing that the libpng implementation has a bug where it doesn't actually read/write this integer, or is, at least, not checking for this in the unit-tests.

I tried my own Python implementation, pngexifinfo, and that one can
see the IFDs. It displays the following:

$ pngexifinfo.py pngtest.png
EXIF (endian=MM)
Orientation (274) (type=3:short) (count=1) : 0x00050000
EXIF IFD (34665) (type=4:long) (count=1) : 0x00000026
[Unknown] (41989) (type=3:short) (count=1) : 0x012c0000

Then I tried exiftool, and that one, too, works fine.

I think the EXIF field in pngtest.png is correct, and you are probably
having a bug in your implementation.

Sincerely,
Cosmin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot