Available in the LEADTOOLS Imaging toolkit. |
Exif File Comments
When reading or updating Exif comments, you must specify the comment type using the following constants.
For a loop counter:
Value Meaning
CMNT_LAST Last defined number for comments. To get all comments, you can use the comment type constant as a loop counter. The first constant is 0 and the last is CMNT_LAST.
TIFF comments in Exif files: All Exif files (TIFF and JPG) can contain the following TIFF comments. Each TIFF comment field can contain a character string. The maximum field size is 32K, except for the date-time field, which is always 20.
Value Meaning
CMNT_SZARTIST Person who created the image.
CMNT_SZCOPYRIGHT Copyright notice.
CMNT_SZDATETIME Date and time (YYYY:MM:DD HH:MM:SS). The field length is 20, counting the NULL terminator.
CMNT_SZDESC Description of the image.
CMNT_SZHOSTCOMP Computer and operating system in use.
CMNT_SZMAKE Manufacturer of the equipment used to create the image.
CMNT_SZMODEL Model name and number of the equipment.
CMNT_SZNAMEOFDOC Name of the document from which the image was scanned.
CMNT_SZNAMEOFPAGE Page name from which the image was scanned.
CMNT_SZSOFTWARE Name and version of software package used to create the image.
General Exif comments: Exif files can contain the following general comments. Each comment field is constrained by its Exif data type.
Value Meaning
CMNT_EXIFVERSION Exif version. LEADTOOLS always writes this value as 0100, meaning version 1. Data type: UNDEFINED. Length: 4.
CMNT_SZSUBSECTIME Decimal extension for seconds that are specified in the CMNT_SZDATETIME field. Data type: ASCII. Length: variable.
CMNT_SZDATETIMEORIGINAL Date and time the original image is captured. The format is YYYY:MM:DD HH:MM:SS. The time is in a 24-hour format, and a blank space is left between the date and the time. Data type: ASCII. Length: 20.
CMNT_SZSUBSECTIMEORIGINAL Decimal extension for seconds that are specified in the CMNT_SZDATETIMEORIGINAL field. Data type: ASCII. Length: variable.
CMNT_SZDATETIMEDIGITIZED Date and time the file is generated. If the file is generated directly, as with a digital camera, this is the same as the time the original image is captured. Data type: ASCII. Length: 20.
CMNT_SZSUBSECTIMEDIGITIZED Decimal extension for seconds that are specified in the CMNT_SZDATETIMEDIGITIZED field. Data type: ASCII. Length: variable.
CMNT_SHUTTERSPEEDVALUE Shutter speed. The unit of measure is APEX. Data type: SRATIONAL. Length: 1.
CMNT_APERTURE Aperture value. This is the ratio of lens aperture for the focal length. The unit of measure is APEX. Data type: RATIONAL. Length: 1.
CMNT_BRIGHTNESS Brightness value. Data type: SRATIONAL. Length: 1.
CMNT_EXPOSUREBIAS Exposure bias. This is the value for correcting a biased exposure. The unit of measure is APEX. Data type: SRATIONAL. Length: 1.
CMNT_MAXAPERTURE Minimum lens f-number. Data type: RATIONAL. Length: 1.
CMNT_SUBJECTDISTANCE Distance from lens to subject (in meters). Data type: RATIONAL. Length: 1.
CMNT_METERINGMODE Photometry mode. Possible values
are
0 = Unidentified
1 = Average
2 = Center Weighted Average
3 = Spot
4 = MultiSpot
5 = Pattern
6 = Partial
255 = Others
Data type: SHORT. Length: 1.
CMNT_LIGHTSOURCE Light source. Possible values are
0 = Unidentified
1 = Daylight
2 = Florescence light
3 = Tungsten Lamp
17 = Standard light source A
18 = Standard light source B
19 = Standard light source C
20 = D55
21 = D65
22 = D75
255 = Others
Data type: SHORT. Length: 1.
CMNT_FLASH Flash On/Off. Possible values are 1 for on or 0 for off. Data type: SHORT. Length: 1.
CMNT_FOCALLENGTH Focal length, measured in millimeters. Data type: RATIONAL. Length: 1.
CMNT_EXPOSURETIME Exposure time, expressed as a fraction of a second. Data type: RATIONAL. Length: 1.
CMNT_FNUMBER The actual lens F stop (ratio of lens aperture to focal length). Data type: RATIONAL. Length: 1.
CMNT_MAKERNOTE Maker note. Data type: UNDEFINED. The creator of the file determines the data format.
CMNT_USERCOMMENT User comment. Data type: UNDEFINED.
Length: variable. The first eight bytes specify the data format, and the
remainder of the comment is in the specified format. The first eight bytes
can be any of the following:
41 53 43 49 49 00 00 00 = ASCII
4A 49 53 00 00 00 00 00 = JIS (Japanese)
00 00 00 00 00 00 00 00 = Undefined
CMNT_SUPPORTEDFLASHPIXVERSION Supported FlashPix version (Exif 2.0). LEADTOOLS always writes 0100 here. Data type: UNDEFINED. Length: 4
CMNT_COLORSPACE Color space (Exif 2.0). Specifies
whether the color is calibrated or not. LEADTOOLS always writes this value
as 1. Data type: SHORT. Length: 1 Possible
values are:
1 = sRGB (PC monitor conditions)
0xFFFF = Uncalibrated
Other = reserved
CMNT_EXPOSUREPROGRAM Exposure program (Exif 2.0)
The class of the program used by the camera to set exposure when the picture
is taken. Data type: SHORT. Length = 1.
Possible values are:
0 = Not defined
1 = Manual
2 = Aperture priority
4 = Shutter priority
5 = Creative program (biased toward depth of field)
6 = Action program (biased toward fast shutter speed)
7 = Portrait mode (for closeup photos with the background out of focus)
Other = reserved
CMNT_SZSPECTRALSENSITIVITY Spectral sensitivity (Exif) - The spectral sensitivity of each channel of the camera used. It is an ASCII string compatible with the standard developed by the ASTM technical committee. Data type: ASCII. Length: any
CMNT_ISOSPEEDRATINGS ISO speed ratings (Exif) - the ISO speed and the ISO Latitude of the camera or input device as specified in ISO 12232 Data type: SHORT. Length: any
CMNT_OPTOELECTRICCOEFFICIENT Optoelectric coefficient (Exif) - Opto-Electric Conversion function specified in ISO 14524. OECF is the relationship between the camera optical input and the image values. Data type: UNDEFINED. Length: ANY. This is an array of m rows and n columns. For information on how it is recorded, refer to OECF.
CMNT_SZRELATEDSOUNDFILE Related audio file (Exif) - the name of an audio file related to the image data. The name should be 8 ASCII chars + '.' + 3 chars for extension + NULL. Data type: ASCII. Length: 13.
CMNT_FLASHENERGY Flash energy (Exif) - the strobe energy at the time the image iscaptured, as measured in Beam Candle Power Seconds (BPCS) Data type: RATIONAL. Length: 1
CMNT_SPATIALFREQUENCYRESPONSE Spatial frequency response (Exif) - the camera or input device spatial frequency table and SFR values in the direction of image width, image height and diagonal direction, as specified in ISO 12233. Data type: UNDEFINED. Length: ANY This is an array of m rows and n columns.For information on how this is recorded, refer to SFR.
CMNT_FOCALPLANEXRESOLUTION Focal plane X Resolution (Exif) - the number of dots per inch on the camera focal plane in the image width (X) direction
CMNT_FOCALPLANEYRESOLUTION Focal plane Y Resolution (Exif) - the number of dots per inch on the camera focal plane in the image height (Y) direction
CMNT_SUBJECTLOCATION Subject location (Exif) - the location of the main subject in the scene. The first value is the X column number and the second is the Y row number. Data type: SHORT. Length: 2
CMNT_EXPOSUREINDEX Exposure index (Exif) - the image sensor type on the camera or input device. Data type: SHORT. Length: 1
CMNT_SENSINGMETHOD Sensing method (Exif) - the image
sensor type on the camera or input device. Data type: SHORT.
Length: 1 Possible values are:
1 = not defined
2 = one-chip color area sensor
3 = two-chip color area sensor
4 = three-chip color area sensor
5 = color sequential area sensor
7 = trilinear sensor
8 = color sequential sensor
other = reserved
CMNT_FILESOURCE File source (Exif) - the image source.
If a digital camera recorded the image, the value will always be 3, to
indicate that the image was recorded on a digital camera. Data type: SHORT. Length: 1 Possible values are:
3 = image recorded on a DSC (Digital Still Camera)
other = reserved
CMNT_SCENETYPE Scene type (Exif) - the type of scene.
If a DSC recorded the image, this value will always be 1, indicating that
the image was directly photographed. Data type: UNDEFINED.
Length: 1 Possible values are:
1 = a directly photographed image
other = reserved
CMNT_CFAPATTERN CFA Pattern (Exif) - the color filter array (CFA) geometric pattern of the image sensor when a one-chip color sensor was applied. It does not apply to any other sensing methods. Data type: UNDEFINED. Length: ANY This is an array m x n (horz x vertical), where the pattern is repeated every m pixels on the horizontal and n pixels on the vertical. For a table of the layout, refer to CFA.
CMNT_SUBJECTAREA Location and area of the main subject in the overall scene. Data type: SHORT. Count: 2 (Location of the subject is given in X, Y coordinates), 3 (Area of the main subject is given as a circle, X, Y, D, where X and Y are the center coordinates and D is the diameter.) and 4 (Area of the main subject is given as a rectangle, X, Y, W, H, where X and Y are the center coordinates, W is the width or the rectangle and H is the height of the rectangle.).
CMNT_CUSTOMRENDERED Use of special processing on image data, such as rendering geared toward output. When special processing is performed, the reader is expected to disable or minimize any further processing. Data type: SHORT; Count: 1; Possible Values: 0 (Normal process), 1 (Custom process), Other (Reserved). Default: 0;
CMNT_EXPOSUREMODE Exposure mode set when the image was shot. In auto-bracketing mode the camera shoots a series of frames of the same scene at different exposure settings. Tag: 41986; Data type: SHORT; Count: 1; Possible values are: 0 (Auto exposure), 1 (Manual exposure), 2 (Auto-bracket), Other (Reserved); Default: none.
CMNT_WHITEBALANCE White balance mode set when the image was shot. Data type: SHORT; Count: 1; Possible values are: 0 (Auto white balance), 1 (Manual white balance), Other (Reserved); Default: none.
CMNT_DIGITALZOOMRATIO Digital zoom ratio set when the image was shot. If the numerator of the recorded value is 0, the digital zoom was not used. Data type: RATIONAL; Count: 1; Default: none.
CMNT_FOCALLENGTHIN35MMFILM Equivalent focal length, assuming a 35mm film camera, in mm. A value of 0 means the focal length is unknown. Note that this comment is different from the CMNT_FOCALLENGTH comment. Data type: SHORT; Count: 1; Default: none.
CMNT_SCENECAPTURETYPE Type of scene that was shot. It can also be used to record the mode in which the image was shot. Note that this differs from the CMNT_SCENETYPE comment. Data type: SHORT; Count: 1; Possible values are: 0 (Standard), 1 (Landscape), 2 (Portrait), 3 (Night scene), Other (Reserved); Default: 0.
CMNT_GAINCONTROL Degree of overall image gain adjustment. Data type: SHORT; Count: 1; Possible values are: 0 (None), 1 (Low gain up), 2 (High gain up), 3 (Low gain down), 4 (High gain down), Other (Reserved); Default: none.
CMNT_CONTRAST Direction of contrast processing applied by the camera when the image was shot. Data type: SHORT; Count: 1; Possible values are: 0 (Normal), 1 (Soft), 2 (Hard), Other (Reserved); Default: 0.
CMNT_SATURATION Direction of saturation processing applied by the camera when the image was shot. Data type: SHORT; Count: 1; Possible values are: 0 (Normal), 1 (Low saturation), 2 (High saturation), Other (Reserved); Default: 0.
CMNT_SHARPNESS Direction of sharpness processing applied by the camera when the image was shot. Data type: SHORT; Count: 1; Possible values are: 0 (Normal), 1 (Soft), 2 (Hard), Other (Reserved); Default: 0.
CMNT_DEVICESETTINGSDESCRIPTION Information on the picture-taking conditions of a particular camera model. Used only to indicate the picture-taking conditions in the reader. Data type: UNDEFINED; Count: Any; The data is recorded in Unicode using SHORT fro the number of display rows and columns and UNDEFINED for the camera settings. The Unicode (UCS –2) string including Signature is NULL terminated. The specifics of the Unicode string are as given in ISO/IEC 10464-1. Default: none.
CMNT_SUBJECTDISTANCERANGE Distance to the subject. Data type: SHORT; Count: 1; Possible values are: 0 (Unknown), 1 (Macro), 2 (Close view), 3 (Distant view), Other (Reserved); Default: none.
CMNT_SZIMAGEUNIQUEID Identifier assigned uniquely to each image. It is recorded as an ASCII string equivalent to hexadecimal notation and 128-bit fixed length. Tag: 42016; Data type: ASCII; Count: 33; Default: none
Exif GPS comments. Exif files can contain the following GPS (Global Positioning System) comments:
Value Meaning
CMNT_GPSVERSIONID Version number of the GPS image file directory (IFD). The current version is 2.0.0.0. This comment must be included when any GPS comments are used. Unlike the CMNT_EXIFVERSION comment, this comment is written in bytes. A version written as 2.0.0.0 is actually 0x02000000 when coded. Data type: BYTE. Length: 4.
CMNT_GPSLATITUDEREF North or south latitude. Possible values are "N" for north and "S" for south. Data type: ASCII. Length: 2.
CMNT_GPSLATITUDE Latitude, expressed as three RATIONAL values. When expressed in degrees, minutes, and seconds, latitude is written as dd/1,mm/1,ss/1. If degrees and minutes are used as the units, and minutes are written with fractions to two decimal places, then latitude is expressed as dd/1,mmmm/100,0/1. Data type: RATIONAL. Length: 3.
CMNT_GPSLONGITUDEREF East or west longitude. Possible values are "E" for east and "W" for west. Data type: ASCII. Length: 2.
CMNT_GPSLONGITUDE The longitude, expressed as three RATIONAL values. When expressed in degrees, minutes and seconds, longitude is written as ddd/1,mm/1,ss/1. If degrees and minutes are used as the units, and minutes are written with fractions to two decimal places, then longitude is expressed as dd/1,mmmm/100,0/1. Data type: RATIONAL. Length: 3.
CMNT_GPSALTITUDEREF Reference altitude. In the current version, sea level is used as the reference, which must be zero. The reference unit is meters. Data type: BYTE. Length: 1.
CMNT_GPSALTITUDE Altitude, in meters, relative to the reference altitude. Data type: RATIONAL. Length: 1.
CMNT_GPSTIMESTAMP Time stamp in UTC (Coordinated Universal Time) time. The time is expressed as three RATIONAL values, for hours, minutes, and seconds. Data type: RATIONAL. Length: 3.
CMNT_GPSSATELLITES GPS satellites used for measurement. The coding format is not stipulated. This comment can be used to code information such as the number of satellites, the satellite number, the satellite's angle of elevation, its azimuth, and its SNR. If the GPS receiver cannot make a measurement, this comment is NULL. Data type: ASCII. Length: variable.
CMNT_GPSSTATUS Status of the GPS receiver at when the image is recorded. Possible values are "A" when measurement in progress and "V" when measurement is interrupted. Data type: ASCII. Length: 2.
CMNT_GPSMEASUREMODE GPS measurement mode. A value of "2" denotes two-dimensional measurement, and "3" denotes three-dimensional measurement. Data type: ASCII. Length: 2.
CMNT_GPSDOP DOP (data precision) value. This comment is an HDOP value during two-dimensional measurement and a PDOP value during three-dimensional measurement. Data type: RATIONAL. Length: 1.
CMNT_GPSSPEEDREF Unit for measuring speed. Possible values are "K" for kilometers, "M" for miles, and "N" for knots. Data type: ASCII. Length: 2.
CMNT_GPSSPEED Speed of the GPS receiver. Data type: RATIONAL. Length: 1.
CMNT_GPSTRACKREF Reference for direction of movement. Possible values are "T" for a true direction and "M" for a magnetic. Data type: ASCII. Length: 2
CMNT_GPSTRACK Direction of GPS receiver movement. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSIMGDIRECTIONREF Reference for the direction of photography in the recorded image. Possible values are "T" for a true direction and "M" for a magnetic. Data type: ASCII. Length: 2.
CMNT_GPSIMGDIRECTION Direction of photography in the recorded image. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSMAPDATUM Geodetic survey data used by the receiver. If the geodetic survey data is restricted to Japan, this tag value is "TOKYO" or "WGS-84". Data type: ASCII. Length: variable.
CMNT_GPSDESTLATITUDEREF North or south latitude for the destination point. Possible values are "N" for north and "S" for south. Data type: ASCII. Length: 2.
CMNT_GPSDESTLATITUDE Latitude of the destination point. The latitude is expressed as three RATIONAL values, indicating degrees, minutes and seconds. Data type: RATIONAL. Length: 3.
CMNT_GPSDESTLONGITUDERE East or west longitude for the destination point. Possible values are "E" for east and "W" for west. Data type: ASCII. Length: 2.
CMNT_GPSDESTLONGITUDE Longitude of the destination point. The longitude is expressed as three RATIONAL values, indicating degrees, minutes and seconds. Data type: RATIONAL. Length: 3.
CMNT_GPSDESTBEARINGREF Reference for the bearing to the destination point. Possible values are "T" for a true direction and "M" for a magnetic. Data type: ASCII. Length: 2.
CMNT_GPSDESTBEARING Bearing to the destination point. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSDESTDISTANCEREF Unit for measuring distance to the destination point. Possible values are "K" for kilometers, "M" for miles, and "N" for nautical miles. Data type: ASCII. Length: 2.
CMNT_GPSDESTDISTANCE Distance to the destination point. Data type: RATIONAL. Length: 1.
CMNT_GPSPROCESSINGMETHOD Processing method. Data type: Byte. Length: Any.
CMNT_GPSAREAINFORMATION Area. Data type: Byte. Length: Any.
CMNT_GPSDATESTAMP Date. Data type: SZ. Length: 11.
CMNT_GPSDIFFERENTIAL Differential. Data type: Short. Length: 1.