Does PNG contain EXIF data like JPG?
I was wondering if PNG contains data like the following?
What I did was to convert the jpg file to png format, and I was expecting to retrieve the same info I had on the jpg as below:
Currently using this as3 library to read the data.
- IDF0--- IDF @[134 - 248] (9 entries)
- Orientation (SHORT) : 1
- XResolution (RATIONAL) : 72/1
- YResolution (RATIONAL) : 72/1
- ResolutionUnit (SHORT) : 2
- Software (ASCIIx16) : QuickTime 7.6.6
- DateTime (ASCIIx20) : 2011:10:02 22:43:37
- HostComputer (ASCIIx16) : Mac OS X 10.6.8
- Exif IFD (LONG) : 8 34853
- GPS IFD (LONG) : 248
- EXIF IDF--- IDF @[8 - 134](10 entries)
- ExifVersion (UNDEFINEDx4) : 0220
- DateTimeOrigina (ASCIIx20) : 2011:04:14 17:22:01
- UserComment (UNDEFINEDx63) : ASCII
- FlashpixVersion (UNDEFINEDx4) : 0100
- ColorSpace (SHORT) : 1
- PixelXDimension (LONG) : 1022
- PixelYDimension (LONG) : 486
- Unknown (ASCIIx13) : Image Tag-LOL
- SceneCaptureType (SHORT) : 0
- GPS IDF--- IDF @[248 - 338](7 entries)
- Interoperability Index (ASCIIx2) : N
- Interoperability Version (RATIONALx3) @425: 52/1, 1144/100, 0/1
- Unknown (ASCIIx2) : W
- Unknown (RATIONALx3) : 1/1, 4392/100, 0/1
- Unknown (RATIONAL) : 5/1
- Unknown (ASCIIx2) : T
- Unknown (RATIONAL) : 3694/117
Solution 1:
Edit: Version 1.5.0 (July 2017) of the Extensions to the PNG 1.2 Specification has finally added an EXIF chunk. It remains to be seen if encoders-decoders begin to support it.
Original: PNG does not embed EXIF info. It allows, however, to embed metadata "chunks" inside the image. Some of the standardized chunks correspond to a few EXIF attributes (physical dimensions, timestamp). And it's also possible to store arbitrary textual data as key=>value
pairs, or to define new chunk types. So, you could in theory store any EXIF information... but, alas, in your own custom format. Some attempts to standarize have not caught up, it seems.
Solution 2:
Edit: As of July 2017, PNG officially supports an eXIf chunk to store EXIF metadata (specification). ExifTool 10.59 and later write EXIF to this new chunk in PNG images.
Original: ImageMagick stores EXIF information in a PNG "Raw profile type APP1" zTXt chunk when converting from JPEG images. This method of storing EXIF in PNG images is also supported by ExifTool (and I believe Exiv2 too), but it is not part of the PNG or EXIF specification.
Solution 3:
PNG does not support embedding of EXIF information. When you convert from JPEG to PNG the information is lost.
Solution 4:
As of July 2017, there does appear to be officially registered chunk for EXIF data called... eXIf:
The data segment of the eXIf chunk contains an Exif profile in the format specified in "4.7.2 Interoperability Structure of APP1 in Compressed Data" of [CIPA DC-008-2016] except that the JPEG APP1 marker, length, and the "Exif ID code" described in 4.7.2(C), i.e., "Exif", NULL, and padding byte, are not included.
Note that this is both A) only a few months old (as of writing) and B) an optional extension, not part of the basic specification. Therefore, support for the eXIf chunk might be limited in many applications.