Re: EXIF support in PNG - PngSuite image with EXIF chunk

Glenn Randers-Pehrson <[email protected]>
Newsgroups gmane.comp.graphics.png.general
Message-ID <CA+PdXct=1LfCiK+h1A-ZVaZHDxAS3Fz+ERP1WN5_3VKAyqG4Bg@mail.gmail.com>
It's not a good idea to use "registered" chunknames for experimental
chunks.

I patched your image to make the test chunk "uxIf" instead of "eXIf",
and added a compressed one called "zxIf" which has a zero compression
method byte followed by zlib-compressed data.

Here are pngcheck -vf results for the three png files (your original and
the two new ones):

glenn.rp> pngcheck -vf *.png
File: exif2c08.png (1794 bytes)
  chunk IHDR at offset 0x0000c, length 13
    32 x 32 image, 24-bit RGB, non-interlaced
  chunk eXIf at offset 0x00025, length 984:  illegal (unless recently
approved) unknown, public chunk
  chunk IDAT at offset 0x00409, length 741
    zlib: deflated, 4K window, default compression
  chunk IEND at offset 0x006fa, length 0
ERRORS DETECTED in exif2c08.png

File: uxif2c08.png (1794 bytes)
  chunk IHDR at offset 0x0000c, length 13
    32 x 32 image, 24-bit RGB, non-interlaced
  chunk uxIf at offset 0x00025, length 984
    unknown private, ancillary, safe-to-copy chunk
  chunk IDAT at offset 0x00409, length 741
    zlib: deflated, 4K window, default compression
  chunk IEND at offset 0x006fa, length 0
No errors detected in uxif2c08.png (4 chunks, 41.6% compression).

File: zxif2c08.png (1438 bytes)
  chunk IHDR at offset 0x0000c, length 13
    32 x 32 image, 24-bit RGB, non-interlaced
  chunk zxIf at offset 0x00025, length 628
    unknown private, ancillary, safe-to-copy chunk
  chunk IDAT at offset 0x002a5, length 741
    zlib: deflated, 4K window, default compression
  chunk IEND at offset 0x00596, length 0
No errors detected in zxif2c08.png (4 chunks, 53.2% compression).

Errors were detected in 1 of the 3 files tested.
No errors were detected in 2 of the 3 files tested.


On Sat, Jan 7, 2017 at 5:08 PM, Willem van Schaik <[email protected]> wrote:

>
> I created a PNG with EXIF chunk for PngSuite
>
> how I did it:
>
> - created in GIMP a simple JPEG image exif-org.jpg
>
> - shrink the image into a tiny thumbnail
>
>   $ jpegtopnm exif-org.jpg | pnmscale -xysize 8 8 | pnmtojpeg -q 90 >
>   exif-thp.jpg
>
> - used exiftool to add an APP1 block with EXIF data
>
>   $ exiftool -exif:exifversion=0220 -exif:copyright="2017 Willem
>   van Schaik" -exif:usercomment=PngSuite -exif:orientation=horizontal
>   -exif:xresolution=72 -exif:yresolution=72 -exif:resolutionunit=inches
>   "-thumbnailimage<=exif-thp.jpg" -o exif2c08.jpg exif-org.jpg
>
> - check the EXIF data with both 'eog exif2c08.jpg' and 'exiftool'
>
> - snipped out the EXIF data
>
>   $ dd skip=24 count=984 bs=1 if=exif2c08.jpg of=exif-app.dat
>
> - using dd to cut a PNG file into pieces
>
> - create some binary bits and pieces
>
>   $ echo -n -e "\x00\x00\x03\xd8\x65\x58\x49\x66" > exif-chk.dat
>   $ echo -n -e "\x00\x00\x00\x00" > exif-crc.dat
>
> - used cat to glue the whole thing together (with CRC zero)
>
>   $ cat exif-one.png exif-chk.dat exif-app.dat exif-crc.dat
>   exif-two.png > exif2c08.png
>
> - finally pngcsum (http://schaik.com/png/pngcsum.html) to fix the CRC
>
> attached the results
>
> view it with "hexdump -C exif2c08.png"
>
> Willem
>
>
>
> On 2017-01-03 19:31, John Bowler wrote:
>
>> ================================================================
>> PNG CHUNK PROPOSAL: eXIf
>>
>> SPECIFICATION
>> =============
>>
>> The four-byte chunk type field contains the decimal values
>>
>> 101 88 73 102
>>
>> The eXIf chunk contains EXIF metadata with a length given by the chunk
>> length.  Such data shall be compatible with specifications issued by
>> CIPA, "Exchangeable image file format for digital still cameras" [CIPA
>> DC-008-2016] or its successors.
>>
>> At most one eXIf chunk shall occur in a PNG stream.  The chunk has no
>> chunk-specific positioning requirements; it may appear before or after
>> the IDAT chunks.
>> ================================================================
>>
>
>
> --
>
> Willem van Schaik
> <[email protected]>
> http://www.schaik.com/
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> png-mng-misc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/png-mng-misc
>
>

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

_______________________________________________
png-mng-misc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/png-mng-misc
uxif2c08.png (image/png, 1.8 KB) - not displayed
zxif2c08.png (image/png, 1.4 KB) - not displayed
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.