Re: libpng warning: eXIf: duplicate - what does it mean?

Ben Bullock <[email protected]> Fri, 11 Dec 2020 15:39:06 +0900
Newsgroups gmane.comp.graphics.png.devel
Message-ID <CAN5Y6m8uXpv1Ywa=41DsN34B6Bnqpi_NkixRti7o2W=07Kqe-A@mail.gmail.com>
On Fri, 11 Dec 2020 at 15:17, Ben Bullock <[email protected]>
wrote:

>
>
> On Fri, 11 Dec 2020 at 15:03, Ben Bullock <[email protected]>
> wrote:
>
>>
>> What could be causing this error?
>>
>
> Examining the output png file with hexdump, it actually appears to have
> two eXIf chunks:
>
...

> So while the duplicate error seems to be valid, I'm not sure how it got
> two chunks.
>
> What error might I have made which caused this to happen?
>

In lpng1637, looking at pngwrite.c, png_write_eXIf is called twice,
in png_write_end and in png_write_info.

https://github.com/glennrp/libpng/blob/libpng16/pngwrite.c#L241
https://github.com/glennrp/libpng/blob/libpng16/pngwrite.c#L443

The other chunks seem to have some kind of protection to stop them from
being written twice, but the eXIf chunk structure doesn't seem to have
anything like that, nor can I see anything in png_write_eXIf in pngwutil:

https://github.com/glennrp/libpng/blob/libpng16/pngwutil.c#L1477

It appears writing the eXIf chunk twice is the normal behaviour? Then why
does the error appear when reading the PNG file back again?

_______________________________________________
png-mng-implement mailing list
png-mng-implement-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/png-mng-implement