PNG and MNG tools |
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].
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.
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).
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.
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:
|
TIFF/EP Tag | Exif Item Name | Note | PNG 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. |
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.
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 Name | PNG encoding | TIFF/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 NUMBER | 0x103 |
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 STRING | tE | 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 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.
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.
[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