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

Willem van Schaik <[email protected]>
Newsgroups gmane.comp.graphics.png.general
Message-ID <[email protected]>
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
exif2c08.jpg (image/jpeg, 2.1 KB) - not displayed
exif2c08.png (image/png, 1.8 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.