PNG eXIf proposal

John Bowler <[email protected]>
Newsgroups gmane.comp.graphics.png.general
Message-ID <CAP7U398WV6X7QZ6PO9VFfCK+n7zyU8tn14N6KgtT1wvzDdU-2Q@mail.gmail.com>
I've completed my work implementing support for eXIf.  The now tested
code is here:

https://github.com/jbowler/jpegtopng/tree/0.0.0

The implementation of read support is in the two files:

pngexif/pngexif.h
https://github.com/jbowler/jpegtopng/blob/0.0.0/pngexif/pngexif.h
pngexif/pngexif.c
https://github.com/jbowler/jpegtopng/blob/0.0.0/pngexif/pngexif.c

This code supports both the proposal, in the functions
png_set_keep_exif and png_get_exif, and the (existing) text chunk
based support via the function png_get_legacy_exif so the benefits on
the read side of the proposal can be clearly seen.

The write side is supported by the program jpegtopng; this supports
both EXIF and XMP metadata preserval.  The program does not rely on
libpng.  The XMP data is stored in a text chunk as documented in the
XMP specification.  In that file the EXIF support is at lines
513..517, the XMP support follows immediately after; both metadata
occur as a JPEG APP1 marker.

The main program, which uses the pngexif code referenced above, is
pngdumpmeta.  This is a very basic C program to read a PNG file from
stdin and write a specified part of the metadata to stdout.  It uses
the existing exiv2 library to list the contents of the EXIF chunk and
some separate (new) code in the hutf8 directory to validate the XMP
data at the UTF-8 level (i.e. no attempt is made to check the data
against the XMP DTD).

I've tested jpegtopng and pngdumpmeta on 9 files each the output of a
different digital camera.  The test photographs were taken between
2010 and 2016 so a wide range of different technologies are
represented.  Exiv2 identifies (and handles) errors in two of the
early pictures, apparently both within the "MakerNote"; i.e. the
camera manufacturer internal information.  I also tested Willem's JPEG
and the recent GIMP output file.

In the proposal the JPEG tag that is used to identify the APP1 marker
as containing EXIF data is retained in the PNG format.  This means
that the private tag (exIf) has the same format as the proposed tag
(exIF), however those leading 6 bytes could be removed in the approved
format.  I am inclined not to do so because the tag is also preserved
in the legacy format; removing it might cause confusion.

-- 
John Bowler <[email protected]>
+1 (541) 450-9885
PO BOX 3151
KERBY OR 97531-3151
USA

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.