Page 1 of 1

PNG eXIF chunk proposal

Posted: 2017-05-28T09:01:12-07:00
by glennrp
During January and February 2017 the PNG Development Group discussed
a proposed eXIf chunk for storing the Exif profile. See
http://www.simplesystems.org/png-group/proposals/eXIf/

The PNG group discussion has lapsed without action on the proposal. The proposal
was pretty simplistic: just copy whatever is in a JPEG APP1 chunk, minus
a few overhead bytes, into the eXIf chunk.

I implemented the proposal in ImageMagick/coders/png.c
(currently #ifdef'ed out, but can be enabled with -DexIf_SUPPORTED)
to simply copy ImageMagick's Exif property, minus the first few bytes,
into an eXIf chunk.

One troublesome aspect was that the ImageMagick "Exif" property can contain
the JPEG thumbnail image, which isn't strictly a part of Exif.

I'm thinking of updating the proposal to declare that the thumbnail should not be
included in the exIf chunk data, and rewriting the ImageMagick chunk support to
eliminate or ignore it.

People wanting to preserve the thumbnail should use a different
private chunk for that.

Thoughts?

Re: PNG eXIF chunk proposal

Posted: 2017-05-29T09:49:57-07:00
by Jason S
One troublesome aspect was that the ImageMagick "Exif" property can contain
the JPEG thumbnail image, which isn't strictly a part of Exif.
I'm confused. A JPEG thumbnail image is definitely a standard part of Exif. Is there something special about the 'ImageMagick "Exif" property'?

Re: PNG eXIF chunk proposal

Posted: 2017-05-29T10:26:53-07:00
by glennrp
The troublesome part is maintaining the thumbnail when the image is edited. We dealt with that in the chunk proposal by mentioning that the thumbnail might be out of sync with the main image. Specifically, the current draft says "While encoders may choose to update them, there is no expectation that any thumbnails present in the Exif profile have (or have not) been updated if the main image was changed. "

It is also troublesome because PNG is supposed to be a single-image format, and purists think that a thumbnail embedded in a PNG would violate that philosophy. Back in 1995 when we were designing the PNG format, we considered and rejected the idea of having a thumbnail chunk.

Re: PNG eXIF chunk proposal

Posted: 2017-05-29T12:06:45-07:00
by Bonzo
I know what you mean about the jpg thumbnail being out of sink. Out of interest how would a create private chunk in imagemagick?

Re: PNG eXIF chunk proposal

Posted: 2017-05-29T12:12:56-07:00
by snibgo
Any thumbnail will often be out of sync with the main image. For example, a raw file from a camera may contain both a sensor-raw Bayer image, and a camera-processed jpeg. The raw file may be processed to make a tiff, png or jpeg which also contains the in-camera jpeg.

This is a potential source of confusion, but I'm in favour of preserving thumbnails unless deletion is explicitly requested. Yes, it will often be historical, rather than representing a current thumbnail of the main image.

Reconstructing a current thumbnail is easy, if the user wants this. But once a historic thumbnail is removed, it is gone forever.

Re: PNG eXIF chunk proposal

Posted: 2017-05-29T13:31:23-07:00
by glennrp
Bonzo wrote: 2017-05-29T12:06:45-07:00 I know what you mean about the jpg thumbnail being out of sink. Out of interest how would a create private chunk in imagemagick?
Look at the "caNv" chunk support in coders/png.c; this is a fairly simple example of using a user read function to understand a private
chunk. There's also code in coders/png.c to write the caNv chunk and several other private chunks.

Re: PNG eXIF chunk proposal

Posted: 2017-05-29T13:51:55-07:00
by Bonzo
Thank you for the info glennrp but I am not a coder and do not even know how to install Imagemagick without the exe file so there is no way I can modify the png.c file.

I have no use for it but thought if it was straight forward I would take a look.

Re: PNG eXIF chunk proposal

Posted: 2017-05-31T14:13:04-07:00
by glennrp
Thanks for the feedback. We're proceeding with the eXIf chunk proposal, keeping the thumbnail if it's present.

Re: PNG eXIF chunk proposal

Posted: 2017-06-29T09:57:41-07:00
by glennrp
The eXIf chunk proposal is being voted upon now, in the png-mng-misc @ lists.sourceforge.net list.

Re: PNG eXIF chunk proposal

Posted: 2017-07-13T10:00:48-07:00
by glennrp
The eXIf chunk proposal was approved by the PNG Development Group.
I've checked eXIf chunk support into coders/png.c in IM6 and IM7.