ImageMagick

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.

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.

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.

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.

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.