SourceForge

PNG and MNG tools
Exif and PNG

PNG Web Site

Converting TIFF/EP or Exif files to and from the PNG format (Draft 0.20, December 20, 2000)

Notices:

Copyright 2000, Glenn Randers-Pehrson, randeg@alum.rpi.edu, all rights reserved. The original document is available at http://pmt.sourceforge.net/exif/drafts/history/d020.html The latest draft of the document is available at http://pmt.sourceforge.net/exif/drafts.

You may link to this file or (preferably) to the directory in which it resides, but please do not publish this file on your web site without my permission. You may quote portions of this document and portions of the preceding drafts, on web sites and in messages, provided that you include the copyright notice and a link to the original document. If and when this document emerges from draft status, it will be released on more generous terms, identical to those of the PNG extensions document [PNGEXT].

Status of this document

This is a draft of a proposal to the PNG Development Group for registration of a new text keyword (Exif). It has not been approved by any approving body.

This document and the latest version of this document can be found at <http://pmt.sourceforge.net/exif>. If at some date the files move to another site, I intend to leave a link to the new location here, if possible.

A mailing list, "pmt-exif@lists.sourceforge.net" has been established for discussing this project. Visit lists.sourceforge.net/mailman/listinfo/pmt-exif to subscribe or to view the archives.

Scope:

This document proposes a new PNG [PNG] registered keyword, "Exif". It shows how to use these to preserve the Exif information [EXIFFORMAT] that is present in a TIFF/EP [TIFF/EP] file, when converting the file to PNG or JNG [JNG] format (JNG is a sub-format of the MNG (Multiple-image Network Graphics) [MNG] format).

Introduction

When converting an image to PNG or JNG format, it is desireable to preserve the Exif information present in some camera images because

Some of the information, which describes the particulars of the encoding of the original image, is of no use once the image has been converted to another format and need not be preserved.

Applications that convert an image back to the original format need to be able to determine whether the image data has been changed, and whether the saved Exif information is still valid and remains in a machine-readable format.

The PNG format does not presently formally accommodate Exif information. It could be stored in PNG text chunks, but a formal specification for storing Exif information is required, to ensure that the data will remain valid and be machine-readable. This document proposes a new registered "Exif" text keyword and rules for using it in a robust manner, within one of the existing PNG text chunks. By this method, the Exif data can be stored in a manner that is both machine and human readable, and can be examined with existing PNG applications.

The chunk data includes validity information by which applications can determine whether the image data might have been edited in a manner that invalidates the stored Exif information. Applications that modify the image data and do not recognize the proposed Exif keyword, and persons who manually edit the Exif data will fail to update the validity check values; therefore, an invalid check value will serve as an indicator that the image data or the Exif data has been modified and is no longer necessarily valid.

Terminology

Adler-32 CRC
Adler-32 Cyclic Redundancy Check (see the zlib specification [ZLIB] for a sample implementation).
CRLF
A carriage-return, line-feed sequence representing a newline in a string.
Exif
Exchangeable Image File Format [EXIFSPEC]. An image format specified by the Japan Electronic Industry Development Association (JEIDA). "Exif information" refers to the extra information that is contained in TIFF tag format within an Exif file or within a TIFF/EP file, or that has been extracted from one.
line
A sequence of bytes ending with a newline character. A line might be empty.
newline
The ASCII NEWLINE character, also represented as "\n" in this document. Actual NEWLINE characters, not the two-symbol representation ("\", "n") are used in the textExif chunk.
textExif chunk
A PNG iTXt, tEXt, or zTXt chunk that contains Exif information, and whose keyword is "Exif"
textExif entry
A "subkeyword=DATA\n" sequence in a textExif chunk. Abbreviated "tE" in the encoding table.
textExif subkeyword
The subkeyword in a textExif entry. The currently defined set of keywords consists only of upper and lower case ASCII letters, and it is likely that this practice will continue in future TIFF/Exif/DCF specifications, but applications must not depend on this. In fact, any Latin-1 character allowed in PNG text chunks, except for the "=" sign, is conceivable. Any new subkeywords proposed in this document will begin with "PNG_".
TIFF/EP
Tag Image File Format--Electronic Photography. A format for storing bitmapped images, defined by International Standard ISO/DIS 12234-2 [TIFF/EP].
whitespace character
A newline immediately followed by an equal-sign ("\n="), which together represent a single whitespace character, a blank, or a TAB character.
whitespace
Any number of whitespace characters.

Mapping of TIFF/EP tags to PNG chunks:

Tags that provide details about the TIFF compression itself are no longer useful and are dropped. Other tags can be converted to existing PNG chunks, or to a tEXt/zTXt/iTXt chunk using the "Exif" keyword (i.e., a "textExif" chunk), as shown in this table.

Encodings:
  • drop: do not encode the item in the PNG datastream
  • tE: encode the item as a textExif entry in a textExif chunk, in the form "subkeyword=DATA". A textExif entry is terminated by the appearance of a line that does not begin with an equal-sign or by the end of the textExif chunk. A line that begins with an equal-sign is appended to the DATA, without the equal-sign itself. The subkeyword is the same as the tag name and is case dependent. It can appear on a line by itself, without an equal-sign, or it can be followed by an equal-sign and some or all of its DATA. Whitespace separates multiple items in the DATA (but only one whitespace character may separate them, if the second item of a pair being separated is a STRING or SUBSTRING). If there is a discrepancy between the spelling given here and the spelling in [TIFF/EP], the latter shall prevail. The DATA is one or more of
    • NUMBER: a numeric entry written an ASCII string as explained in [PNGEXT]. If there are multiple NUMBERs, they are separated whitespace. (NUMBER is usually a decimal integer, but can also be a decimal with fractional part)
    • CHAR: a single ASCII character.
    • HEX: A byte-order flag consisting of a single ASCII character
      • "L" or "l" (for "Little-endian", also known as Intel style),
      • "G" or "g" (for "biG-endian", also known as Motorola style), or
      • "U" or "u" (for "Unknown" or not applicable),
      followed by a string of bytes, each encoded in hexadecimal format using two ASCII characters 0-9, upper case A-F, and lower case a-f (case independent). Whitespace may be included in strings of HEX bytes to improve readability. Used for writing binary data whose actual contents are unspecified. Multibyte values within a HEX string must be written in the byte order specified by the TIFF header bytes ("II" for "Intel", i.e., "little-endian", or "MM" for "Motorola", i.e., "big-endian). The byte-order flag can be omitted if the byte order is Little-endian, which is the usual order in digital cameras.
    • STRING: a Latin-1 string [LATIN-1] which is the same as a string contained in an Exif or TIFF/EP tag except that the terminating NULL is removed and any embedded newlines or CR,LF sequences are replaced with a newline. A single whitespace character (the "\n=" sequence is considered to be a single whitespace character for this purpose) may precede the STRING and is not included in it. If multiple whitespace characters appear, all but the first form the beginning of the string.
    • SUBSTRING: a Latin-1 string [LATIN-1] which is the same as a string contained in an Exif or TIFF/EP tag, within a tag that has more than one parameter (the OECF tag is the only known example of this). The terminating NULL is replaced with a semicolon and one optional whitespace character, any embedded CR,LF sequences are replaced with a newline and an equal-sign (\n=), and any embedded semicolons are replaced with two consecutive semicolons. Additional whitespace may follow the terminal semicolon if the next item in the list is not a SUBSTRING. For example, a typical OECF tag could be encoded as
          OECF= 4 3\n
          =Camera log exposure; Red output level;\n
          =Green output level; Blue output level;\n
          = -3.0  10.2  12.4   8.9\n
          = -2.0  48.1  47.5  48.3\n
          = -1.0 150.2 152.0 148.9\n
      
    • other: as explained in the table
TIFF/EP TagExif Item NameNotePNG encoding
0x0FE *NewSubfileType  drop
0x0FF *SubfileType  drop
0x100 ImageWidth [1]width in IHDR and tE NUMBER
0x101 ImageLength  height in IHDR and tE NUMBER
0x102 BitsPerSample [2]sBIT
0x103 Compression [3]tE NUMBER
0x106 PhotometricInterpretation  tE
0x10A FillOrder [4]drop?
0x10D DocumentName  text Title STRING
0x10E ImageDescription  text Description STRING
0x10F Make  tE STRING
0x110 Model  tE STRING
0x111 StripOffsets  drop
0x112 Orientation [5] tE NUMBER
0x115 SamplesPerPixel  drop
0x116 RowsPerStrip  drop
0x117 StripByteCounts  drop
0x11A XResolution [6]xppm in pHYs
0x11B YResolution [6] yppm in pHYs
0x11C PlanarConfiguration  tE NUMBER
0x128 ResolutionUnit [6]unit=1 in pHYs
0x12D *TransferFunction [7] tE 3*NUMBER
0x131 Software  tE STRING
0x132 DateTime [8] text Creation time STRING
0x13B Artist  text Author STRING
0x13D *Predictor  drop
0x13E WhitePoint  white point in cHRM
0x13F PrimaryChromaticities  chromaticities in cHRM
0x156 *TransferRange  tE ?
0x15B JPEGTables [9] drop
0x200 JPEGProc  drop
0x201 JPEGInterchangeFormat  drop
0x202 JPEGInterchangeFormatLength  drop
0x211 YCbCrCoefficients [10] drop
0x212 YCbCrSubSampling  drop
0x213 YCbCrPositioning  drop
0x214 ReferenceBlackWhite  tE 2*NUMBER
0x828D CFARepeatPatternDim  tE 2*NUMBER
0x828E CFAPattern  CFArows*CFAcols*NUMBER
0x828F BatteryLevel  tE NUMBER or STRING
0x8298 Copyright  text Copyright
0x829A ExposureTime  tE (1 or 2)*NUMBER
0x829D FNumber  tE (1 or 2)*NUMBER
0x83BB IPTC/NAA  tE NUMBER or STRING
0x8769 ExifOffset  drop
0x8773 InterColorProfile [11] iCCP
0x8822 ExposureProgram  tE NUMBER
0x8824 SpectralSensitivity  tE STRING
0x8825 GPSInfo  write individual GPS tags as tE
 GPSVersionID  tE 4*NUMBER
 GPSLatitudeRef  tE CHAR
 GPSLatitude  tE 3*NUMBER
 GPSLongitudeRef  tE CHAR
 GPSLongitude  tE 3*NUMBER
 GPSAltitudeRef  tE CHAR
 GPSAltitude  tE NUMBER
 GPSTimeStamp  tE 3*NUMBER
 GPSSatellites  tE STRING
 GPSStatus  tE CHAR
 GPSMeasureMode  tE CHAR
 GPSSDOP  tE NUMBER
 GPSSpeedRef  tE CHAR
 GPSSpeed  tE NUMBER
 GPSTrackRef  tE CHAR
 GPSTrack  tE NUMBER
 GPSImgDirectionRef  tE CHAR
 GPSImgDirection  tE NUMBER
 GPSMapDatum  tE STRING
 GPSDestLatitudeRef  tE CHAR
 GPSDestLatitude  tE 3*NUMBER
 GPSDestLongitudeRef  tE CHAR
 GPSDestLongitude  tE 3*NUMBER
 GPSDestBearingRef  tE CHAR
 GPSDestBearing  tE NUMBER
 GPSDestDistanceRef  tE CHAR
 GPSDestDistance  tE NUMBER
0x8827 ISOSpeedRatings  tE (1 or 2)*NUMBER
0x8828 OECF [12] tE ...
0x8829* Interlace  drop
0x882A TimeZoneOffset  tE (1 or 2)*NUMBER
0x882B SelfTimerMode  tE NUMBER
0x9000 ExifVersion  tE 4*NUMBER
0x9003 DateTimeOriginal [13] tE STRING
0x9004 DateTimeDigitized [14] tE STRING
0x9101 ComponentsConfiguration  tE 4*NUMBER
0x9102 CompressedBitsPerPixel  tE NUMBER
0x9201 ShutterSpeedValue  tE NUMBER
0x9202 ApertureValue  tE NUMBER
0x9203 BrightnessValue  tE (1 or 2)*NUMBER
0x9204 ExposureBiasValue  tE (1 or 2)*NUMBER
0x9205 MaxApertureValue  tE NUMBER
0x9206 SubjectDistance  tE (1 or 2)*NUMBER
0x9207 MeteringMode  tE NUMBER
0x9208 LightSource  tE NUMBER
0x9209 Flash  tE NUMBER
0x920A FocalLength  tE (1 or 2)*NUMBER
0x920B FlashEnergy [15] tE (1 or 2)*NUMBER
0x920C SpatialFrequencyResponse  tE STRING
0x920D Noise  tE STRING
0x020E FocalPlaneXResolution  tE NUMBER
0x920F FocalPlaneYResolution  tE NUMBER
0x9210 FocalPlaneResolutionUnit  tE NUMBER
0x9211 ImageNumber  tE NUMBER
0x9212 SecurityClassification  tEXt Warning Classified
 FileSecurityClassification  tE STRING
 FileCodewords  tE STRING
 FileControlAndHandling  tE STRING
 FileReleasingInstructions  tE STRING
 FileClassificationAuthority  tE STRING
 FileSecurityControlNumber  tE STRING
 FileSecurityDowngrade  tE STRING
 FileSecurityDowngradingEvent  tE STRING
0x9213 ImageHistory  tE STRING
0x9214 SubjectLocation  tE (2, 3, or 4)*NUMBER
0x9215 ExposureIndex  tE (1 or 2)*number
0x9216 TIFF/EPStandardID  tE 4*NUMBER
0x9217 SensingMethod  tE NUMBER
0x927C MakerNote [16]tE HEX
0x9286 UserComment  text Comment/tE
0x9290 SubSecTime  tE STRING
0x9291 SubSecTimeOriginal tE STRING
0x9292 SubSecTimeDigitized  tE STRING
0xA000 FlashPixVersion  tE 4*NUMBER
0xA001 ColorSpace  tE NUMBER
0xA002 ExifImageWidth  tE NUMBER
0xA003 ExifImageLength  tE NUMBER
0xA004* RelatedSoundFile  tE STRING
0xA005 InteroperabilityOffset  drop
0xA20B* FlashEnergy [17] tE (1 or 2)*NUMBER
0xA20C* SpatialFrequencyResponse  tE STRING
0xA20E* FocalPlaneXResolution  tE NUMBER
0xA20F* FocalPlaneYResolution  tE NUMBER
0xA210* FocalPlaneResolutionUnit  tE NUMBER
0xA214* SubjectLocation  tE (2, 3, or 4)*NUMBER
0xA215* ExposureIndex  tE (1 or 2)*number
0xA217* SensingMethod  tE NUMBER
0xA300* FileSource  tE NUMBER
0xA301* SceneType  tE NUMBER
  PNG_DigitalZoom [18]tE NUMBER
  PNG_OriginalOrientation [19]tE NUMBER
  PNG_ByteOrder [20]tE NUMBER
  PNG_ImageValidity [21]tE NUMBER
  PNG_AlphaValidity [22]tE NUMBER
  PNG_ExifValidity [23]tE NUMBER
The tag list was obtained from the exifdump source code [EXIFDUMP], and compared with the tag list in the TIFF/EP Standard [TIFF/EP]. See also the "Description of the Exif file format" [EXIFFORMAT], which was generated by inspection of Exif files, without reference to the actual Exif specification [EXIFSPEC].
Notes:
[*] Not in TIFF/EP
[1] If the file is later cropped, don't change the textExif width and height; they record the original width and height.
[2] The sBIT chunk is unnecessary and should not be written if the original file and the PNG file to which it is being converted have the same sample depth.
[3] This identifies the compression method used in the original file.
[4] Details about the original compression are of no further use and should be dropped. If an application converts the PNG file back to a TIFF/EP or ELIF file, it must supply these details with respect to the new file that it is creating.
[5] This identifies the orientation (location of the start pixel) of the image with respect to the scene. Defined values are 1: upper left; 3: lower right; 6: upper right; 8: lower left; 9: unspecified. Converters should orient the pixels in the PNG or JNG file with the first pixel representing the top left corner of the image, using a lossless method of rotation. An application that converts a PNG or JNG back to TIFF/EP format must restore the image to an orientation that has the same width and height as the original, using a lossless method of rotation. The "PNG_OriginalOrientation" field can used to recover the original camera file when an application has rotated the image.
[6] Resolution must be converted to meters
[7] Is this related to gamma? If so, a gAMA chunk should be written. It is recorded in EV units, so it isn't directly gamma.
[8] This is the time the image was originally recorded by the camera. But see also [13]; how do these tags differ?
[9], [10] This information is recorded in the JPEG datastream.
[11] If the ICC profile is the sRGB profile, then write an sRGB chunk instead of an iCCP chunk (note that DCF images are always in sRGB).
[12] The OECF table is stored as
tE rows columns n*header n*value
where n=rows*columns. "rows" and "columns" are written as NUMBER, the n headers are each written as a SUBSTRING (with a semicolon terminating each), and the values are written as NUMBER. [13] A tIME chunk can also be written, containing the time that the image was first converted to the PNG or JNG format. If the image is later modified, the tIME chunk will be overwritten with the modification time.
[14] A text "Creation time" chunk should also be written with this time.
[15] Some of the TIFF tags 0x920B through 0x9217 are duplicates of 0xA20B through 0xA217. The former appear in the ISO Standard for TIFF/EP [TIFF/EP], but the latter have been written by some applications.
[16] Since the contents of MakerNote are not known for all vendors, and since it can contain NULL-terminated strings, it is stored as a string of hexadecimal numbers.
[17] See [15].
[18] Extract the digital zoom factor from the MakerNote, if present, and convert it to a rational number (e.g., PNG_DigitalZoom 2.0). Normal is 1.0.
[19] PNG_OriginalOrientation: Defined values are the same as for Orientation.
[20] PNG_ByteOrder: "L" or "l": Little Endian; "G" or "g": Big Endian. The byte order of multibyte values in the original TIFF/EP or Exif file.
[21] PNG_ImageValidity: The Adler-32 check value, calculated on the image data. The value should be recalculated when the image is edited in a manner that is consistent with the Exif data or when the image and the Exif data are both edited in a consistent manner. See "Calculating Validity Values", below.
[22] PNG_AlphaValidity: The Adler-32 check value, calculated on the image alpha channel data. This tag should be omitted if the image is fully opaque.
[23] PNG_TextValidity: The Adler-32 check value, calculated on the contents of the text chunk, beginning with the Exif keyword, up to and including the newline preceding the PNG_TextValidity tag itself. Applications that modify the Exif text chunk in a manner that is consistent with the image data should recalculate the check value.

Usage of the proposed Exif text keyword

All of the Exif information must be written in a single textExif chunk that contains one or more subkeywords with data. The data for a subkeyword is terminated by the appearance of a line that does not begin with an equal-sign or by the end of the chunk. In TIFF/EP tags whose data is a string ending with a NULL, the terminating NULL is removed, and embedded newlines are permitted. Any CRLF sequences in such strings are replaced with the newline character, then an equal-sign is inserted immediately after each newline in the string. If the string is not the last item in the tag (which presently only occurs in the OECF tag), it is converted to a SUBSTRING as described above. If any character outside the Latin-1 character set is present (which would violate the TIFF/EP Standard but might happen anyway), the strings must be converted to UTF-8 format and the iTXt chunk must be used. The data field of the text chunk must begin with the "Exif" keyword plus this caution not to edit the data manually:

Exif\0CAUTION=Do not manually edit the data in this chunk.\n

Applications that are cognizant of Exif and have edited the image data in a manner that does not invalidate the Exif information must update the PNG_ImageValidity check value and the PNG_TextValidity check value, if they want other applications to be able to check its integrity. If they make changes that invalidate the Exif information, they must remove the PNG_ImageValidity tag. If they change the textExif chunk without invalidating it, they should update its PNG_TextValidity check value.

If an application reorients an image, it must update the "PNG_OriginalOrientation" tag. If it edits the Exif "Orientation" tag, it must also update the "PNG_OriginalOrientation" tag, to maintain the proper relationship between the two values.

Applications that wish to determine the validity of the Exif information contained in the textExif chunks should check for the presence of the PNG_TextValidity tag. If none is present, or if its value does not match the check value when recalculated, it can be concluded that the file has been edited by an application that is not cognizant of Exif. If it is present and valid, then it can be concluded that the Exif information is still valid, if the PNG_ImageValidity check value also matches a recalculated check value over the image pixel data.

If any string in the Exif data has embedded newlines or CRLFs, the PNG_ByteOrder tag must be present.

Mapping of PNG chunk data to TIFF/EP tags:

When decoding a STRING or SUBSTRING, the "newline, equal-sign" sequence is converted to a single embedded newline. When decoding a SUBSTRING, any two consecutive semicolons must be converted to a single semicolon. A NULL character must be appended to any STRING or SUBSTRING. If whitespace follows the terminal for the preceding item in the Exif entry, the first whitespace character is ignored and the remainder form the beginning of the converted string. If necessary according to the PNG_ByteOrder tag, newlines are converted to CR,LF. After these replacements have been accomplished, the string length is computed and written in the TIFF/EP tag along with the string itself.

Any NUMBER is read according to the PNG Extensions document [PNGEXT] and stored as the appropriate type (RATIONAL, LONG, SHORT, etc.) for the TIFF/EP tag being written.

Certain data that describes the image structure (JPEG tables, TIFF tiling, etc.) is dropped during the decoding phase. The encoder must construct these tags appropriate to the JPEG or TIFF image that it is writing.

Exif Item NamePNG encodingTIFF/EP Tag
ApertureValue tE NUMBER 0x9202
Artist text Author STRING 0x13B
BatteryLevel tE NUMBER or STRING 0x828F
BitsPerSample sBIT 0x102
BrightnessValue tE (1 or 2)*NUMBER 0x9203
CFAPattern CFArows*CFAcols*NUMBER 0x828E
CFARepeatPatternDim tE 2*NUMBER 0x828D
ColorSpace tE NUMBER 0xA001
ComponentsConfiguration tE 4*NUMBER 0x9101
CompressedBitsPerPixel tE NUMBER 0x9102
Compression tE NUMBER0x103
Copyright text Copyright 0x8298
DateTime text Creation time STRING 0x132
DateTimeDigitized tE STRING 0x9004
DateTimeOriginal tE STRING 0x9003
DocumentName text Title STRING 0x10D
ExifImageLength tE NUMBER 0xA003
ExifImageWidth tE NUMBER 0xA002
ExifOffset none 0x8769
ExifVersion tE 4*NUMBER 0x9000
ExposureBiasValue tE (1 or 2)*NUMBER 0x9204
ExposureIndex tE (1 or 2)*number 0x9215
ExposureIndex tE (1 or 2)*number 0xA215*
ExposureProgram tE NUMBER 0x8822
ExposureTime tE (1 or 2)*NUMBER 0x829A
FNumber tE (1 or 2)*NUMBER 0x829D
FileClassificationAuthority tE STRING none
FileCodewords tE STRING none
FileControlAndHandling tE STRING none
FileReleasingInstructions tE STRING none
FileSecurityClassification tE STRING none
FileSecurityControlNumber tE STRING none
FileSecurityDowngrade tE STRING none
FileSecurityDowngradingEvent tE STRING none
FileSource tE NUMBER 0xA300*
FillOrder none 0x10A
Flash tE NUMBER 0x9209
FlashEnergy tE (1 or 2)*NUMBER 0xA20B
FlashEnergy tE (1 or 2)*NUMBER 0x920B
FlashPixVersion tE 4*NUMBER 0xA000
FocalLength tE (1 or 2)*NUMBER 0x920A
FocalPlaneResolutionUnit tE NUMBER 0xA210*
FocalPlaneResolutionUnit tE NUMBER 0x9210
FocalPlaneXResolution tE NUMBER 0xA20E*
FocalPlaneXResolution tE NUMBER 0x020E
FocalPlaneYResolution tE NUMBER 0x920F
FocalPlaneYResolution tE NUMBER 0xA20F*
GPSAltitude tE NUMBER  
GPSAltitudeRef tE CHAR  
GPSDestBearing tE NUMBER  
GPSDestBearingRef tE CHAR  
GPSDestDistance tE NUMBER  
GPSDestDistanceRef tE CHAR  
GPSDestLatitude tE 3*NUMBER  
GPSDestLatitudeRef tE CHAR  
GPSDestLongitude tE 3*NUMBER  
GPSDestLongitudeRef tE CHAR  
GPSImgDirection tE NUMBER  
GPSImgDirectionRef tE CHAR  
GPSInfo write individual GPS tags as tE 0x8825
GPSLatitude tE 3*NUMBER  
GPSLatitudeRef tE CHAR  
GPSLongitude tE 3*NUMBER  
GPSLongitudeRef tE CHAR  
GPSMapDatum tE STRING  
GPSMeasureMode tE CHAR  
GPSSDOP tE NUMBER  
GPSSatellites tE STRING  
GPSSpeed tE NUMBER  
GPSSpeedRef tE CHAR  
GPSStatus tE CHAR  
GPSTimeStamp tE 3*NUMBER  
GPSTrack tE NUMBER  
GPSTrackRef tE CHAR  
GPSVersionID tE 4*NUMBER  
IPTC/NAA tE NUMBER or STRING 0x83BB
ISOSpeedRatings tE (1 or 2)*NUMBER 0x8827
ImageDescription text Description STRING 0x10E
ImageHistory tE STRING 0x9213
ImageLength height in IHDR and tE NUMBER 0x101
ImageNumber tE NUMBER 0x9211
ImageWidth width in IHDR and tE NUMBER 0x100
InterColorProfile iCCP 0x8773
Interlace none 0x8829*
InteroperabilityOffset none 0xA005
JPEGInterchangeFormat none 0x201
JPEGInterchangeFormatLength none 0x202
JPEGProc none 0x200
JPEGTables none 0x15B
LightSource tE NUMBER 0x9208
Make tE STRING 0x10F
MakerNote tE HEX 0x927C
MaxApertureValue tE NUMBER 0x9205
MeteringMode tE NUMBER 0x9207
Model tE STRING 0x110
NewSubfileType none 0x0FE*
Noise tE STRING 0x920D
OECF tE ... 0x8828
Orientation tE NUMBER 0x112
PhotometricInterpretation tE 0x106
PlanarConfiguration tE NUMBER 0x11C
PNG_AlphaValidity tE NUMBER  
PNG_ByteOrder tE NUMBER  
PNG_DigitalZoom tE NUMBER  
PNG_ExifValidity tE NUMBER  
PNG_ImageValidity tE NUMBER  
PNG_OriginalOrientation tE NUMBER  
Predictor none 0x13D*
PrimaryChromaticities chromaticities in cHRM 0x13F
ReferenceBlackWhite tE 2*NUMBER 0x214
RelatedSoundFile tE STRING 0xA004*
ResolutionUnit unit=1 in pHYs 0x128
RowsPerStrip none 0x116
SamplesPerPixel none 0x115
SceneType tE NUMBER 0xA301*
SecurityClassification tEXt Warning Classified 0x9212
SelfTimerMode tE NUMBER 0x882B
SensingMethod tE NUMBER 0x9217
SensingMethod tE NUMBER 0xA217*
ShutterSpeedValue tE NUMBER 0x9201
Software tE STRING 0x131
SpatialFrequencyResponse tE STRING 0x920C
SpatialFrequencyResponse tE STRING 0xA20C*
SpectralSensitivity tE STRING 0x8824
StripByteCounts none 0x117
StripOffsets none 0x111
SubSecTime tE STRING 0x9290
SubSecTimeDigitized tE STRING 0x9292
SubSecTimeOriginal STRINGtE 0x9291
SubfileType none 0x0FF*
SubjectDistance tE (1 or 2)*NUMBER 0x9206
SubjectLocation tE (2, 3, or 4)*NUMBER 0x9214
SubjectLocation tE (2, 3, or 4)*NUMBER 0xA214*
TIFF/EPStandardID tE 4*NUMBER 0x9216
TimeZoneOffset tE (1 or 2)*NUMBER 0x882A
TransferFunction tE 3*NUMBER 0x12D*
TransferRange tE ? 0x156*
UserComment text Comment/tE 0x9286
WhitePoint white point in cHRM 0x13E
XResolution xppm in pHYs 0x11A
YCbCrCoefficients none 0x211
YCbCrPositioning none 0x213
YCbCrSubSampling none 0x212
YResolution yppm in pHYs 0x11B

Software

Software applications for converting to and from the PNG format are beyond the scope of this document. It is clearly evident that Thierry Bousch's exifdump [EXIFDUMP] or Matthias Wandel's [JHEAD] software could be easily modified to do the job.

Calculating Validity Values

The PNG_TextValidity value is an unsigned 32-bit number resulting from calculating the Adler-32 check value on the contents of the text chunk, beginning with the first letter of the Exif keyword, up to and including the newline that precedes the PNG_TextValidity tag itself.

If the image is stored as a PNG datastream, the PNG_ImageValidity value is an unsigned 32-bit number resulting from calculating the Adler-32 check value on the pixel data, in the order that the pixels are stored. Each pixel is promoted to 48-bit RGB prior to running it through the Adler-32 function. Greyscale images are promoted by replicating the grayscale samples to form RGB samples. If an alpha channel is present, it is ignored for the purpose of calculating the PNG_ImageValidity value but is used to calculate the PNG_AlphaValidity value.

If the image is stored as a JNG datastream, the PNG_ImageValidity value is an unsigned 32-bit number resulting from calculating the Adler-32 check value on the concatenated raw data contained in the JDAT chunks.

If the image has an alpha channel, the PNG_AlphaValidity value is calculated on the alpha channel. If the image is stored as a PNG datastream, or if the image is stored as a JNG datastream with the alpha channel in IDAT chunks, the value is calculated on the alpha samples, in the order that the samples are stored, promoted to sixteen bits. If the alpha channel is stored in a PNG tRNS chunk, the tRNS data is used to determine the alpha value for each pixel, and the result is promoted to sixteen bits and used in the calculation. If the image is a JNG datastream and the alpha channel is stored in JDAA chunks, the PNG_AlphaValidity value is calculated on the concatenated raw data contained in the JDAA chunks. If the image is fully opaque, the PNG_AlphaValidity tag can be omitted.

The zlib specification [ZLIB] provides a sample implementation of the Adler-32 check value calculation.

Rationale

This section provides some of the reasoning behind the decisions made in forming this proposal.

Why not simply embed the entire TIFF/EP data structure in binary form in a new proposed eXIF or proposed eXIf chunk?

The PNG_ImageValidity value for JNG datastreams is not invariant when inconsequential changes like removing comments or thumbnails is done.

To do:

Issues to be resolved:

Revision history:

References:

[DCFSPEC] Japan Electronic Industry Development Association (JEIDA), "JEIDA Standard: Design rule for Camera File System", version 1.0, December 1998, available in in PDF format at http://www.pima.net/standards/it10/PIMA15740/dcf.htm (English).

[EXIFDUMP] Bousch, Thierry, exifdump.py, v 1.13 (Python source code for exifdump), 1999/08/21, available at
http://topo.math.u-psud.fr/~bousch/exifdump.py

[EXIFFORMAT] Tachibanaya, TsuruZoh, "Description of Exif File Format", Revision 1.2, July 19, 2000, available at
http://www.butaman.ne.jp/~tsuruzoh/Computer/Digicams/exif.html (Japanese) http://www.butaman.ne.jp/~tsuruzoh/Computer/Digicams/exif-e.html (English)

[EXIFSPEC] Japan Electronic Industry Development Association (JEIDA), "Digital Still Camera Image File Format Standard (Exchangeable image file format for digital still cameras: Exif)", version 2.1, June 1998, available in English in PDF format at http://www.pima.net/standards/it10/PIMA15740/exif.htm (English).

[JHEAD] Wandel, Matthias, "Exif Jpeg camera setting parser and thumbnail remover", available at http://www.sentex.net/~mwandel/jhead/

[JNG] Randers-Pehrson, Glenn, et. al., "JNG (JPEG Network Graphics) Specification, version 0.99, December, 2000, available at
ftp://swrinde.nde.swri.edu/pub/mng/documents.

[MNG] Randers-Pehrson, Glenn, et. al., "MNG (Multiple-image Network Graphics) Format, version 0.99", December, 2000, available at
ftp://swrinde.nde.swri.edu/pub/mng/documents.

[MNG-VLC] Randers-Pehrson, Glenn, et. al., "MNG-VLC (Multiple-image Network Graphics--Very Low Complexity) Format, version 0.99", December, 2000, available at
ftp://swrinde.nde.swri.edu/pub/mng/documents.

[PNG] Randers-Pehrson, Glenn, et. al., "PNG (Portable Network Graphics) Specification, version 1.2", July, 1999, available at
ftp://swrinde.nde.swri.edu/pub/png/documents.

[PNGEXT] Randers-Pehrson, Glenn, et. al., "Extensions to the PNG 1.2 Specification, version 1.2.0", July, 1999, available at
ftp://swrinde.nde.swri.edu/pub/png/documents.

[STOKES] Stokes, Michael, "Metadata supports graphics applications", EE Times, April 25, 2000, available at http://www.planetanalog.com/story/OEG20000425S0019 [TIFF/EP] ISO/DIS 12234-2, "Photography---Electronic still picture imaging--- Removable memory---Part 2: Image data format---TIFF/EP", November 24, 1998, available at
http://www.pima.net/standards/iso/standards/documents/N4378.pdf

[ZLIB] Deutsch, L. Peter, and Jean-loup Gailly, "ZLIB Compressed Data Format Specification version 3.3", RFC 1950, Aladdin Enterprises, May 1996.
ftp://ftp.isi.edu/in-notes/rfc1950.txt

Acknowledgments


[HOME] | [UP]