• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* exif-tag.c
2  *
3  * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA  02110-1301  USA.
19  *
20  * SPDX-License-Identifier: LGPL-2.0-or-later
21  */
22 
23 #include <config.h>
24 
25 #include <libexif/exif-tag.h>
26 #include <libexif/i18n.h>
27 #include <stdbool.h>
28 
29 #include <stdlib.h>
30 #include <string.h>
31 
32 #define ESL_NNNN { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED }
33 #define ESL_OOOO { EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_OPTIONAL }
34 #define ESL_MMMN { EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_NOT_RECORDED }
35 #define ESL_MMMM { EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY }
36 #define ESL_OMON { EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_NOT_RECORDED }
37 #define ESL_NNOO { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_OPTIONAL }
38 #define ESL_NNMN { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_NOT_RECORDED }
39 #define ESL_NNMM { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY }
40 #define ESL_NNNM { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_MANDATORY }
41 #define ESL_NNNO { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_OPTIONAL }
42 #define ESL_UUUU { EXIF_SUPPORT_LEVEL_UNKNOWN, EXIF_SUPPORT_LEVEL_UNKNOWN, EXIF_SUPPORT_LEVEL_UNKNOWN, EXIF_SUPPORT_LEVEL_UNKNOWN }
43 #define ESL_GPS { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN }
44 #define ESL_UNKNOWN { ESL_UUUU, ESL_UUUU, ESL_UUUU, ESL_UUUU, ESL_UUUU }
45 
46 /*!
47  * Table giving information about each EXIF tag.
48  * There may be more than one entry with the same tag value because some tags
49  * have different meanings depending on the IFD in which they appear.
50  * When there are such duplicate entries, there must be no overlap in their
51  * support levels.
52  * The entries MUST be sorted in tag order.
53  * The name and title are mandatory, but the description may be an empty
54  * string. None of the entries may be NULL except the final array terminator.
55  */
56 static const struct TagEntry {
57 	/*! Tag ID. There may be duplicate tags when the same number is used for
58 	 * different meanings in different IFDs. */
59 	ExifTag tag;
60 	const char *name;
61 	const char *title;
62 	const char *description;
63 	/*! indexed by the types [ExifIfd][ExifDataType] */
64 	ExifSupportLevel esl[EXIF_IFD_COUNT][EXIF_DATA_TYPE_COUNT];
65 } ExifTagTable[] = {
66 #ifndef NO_VERBOSE_TAG_STRINGS
67 	{EXIF_TAG_GPS_VERSION_ID, "GPSVersionID", N_("GPS Tag Version"),
68 	 N_("Indicates the version of <GPSInfoIFD>. The version is given "
69 	    "as 2.0.0.0. This tag is mandatory when <GPSInfo> tag is "
70 	    "present. (Note: The <GPSVersionID> tag is given in bytes, "
71 	    "unlike the <ExifVersion> tag. When the version is "
72 	    "2.0.0.0, the tag value is 02000000.H)."), ESL_GPS},
73 	{EXIF_TAG_INTEROPERABILITY_INDEX, "InteroperabilityIndex",
74 	 N_("Interoperability Index"),
75 	 N_("Indicates the identification of the Interoperability rule. "
76 	    "Use \"R98\" for stating ExifR98 Rules. Four bytes used "
77 	    "including the termination code (NULL). see the separate "
78 	    "volume of Recommended Exif Interoperability Rules (ExifR98) "
79 	    "for other tags used for ExifR98."),
80 	 { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_OOOO } },
81 	{EXIF_TAG_GPS_LATITUDE_REF, "GPSLatitudeRef", N_("North or South Latitude"),
82 	 N_("Indicates whether the latitude is north or south latitude. The "
83 	    "ASCII value 'N' indicates north latitude, and 'S' is south "
84 	    "latitude."), ESL_GPS},
85 	{EXIF_TAG_INTEROPERABILITY_VERSION, "InteroperabilityVersion",
86 	 N_("Interoperability Version"), "",
87 	 { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_OOOO } },
88 	{EXIF_TAG_GPS_LATITUDE, "GPSLatitude", N_("Latitude"),
89 	 N_("Indicates the latitude. The latitude is expressed as three "
90 	    "RATIONAL values giving the degrees, minutes, and seconds, "
91 	    "respectively. When degrees, minutes and seconds are expressed, "
92 	    "the format is dd/1,mm/1,ss/1. When degrees and minutes are used "
93 	    "and, for example, fractions of minutes are given up to two "
94 	    "decimal places, the format is dd/1,mmmm/100,0/1."),
95 	 ESL_GPS},
96 	{EXIF_TAG_GPS_LONGITUDE_REF, "GPSLongitudeRef", N_("East or West Longitude"),
97 	 N_("Indicates whether the longitude is east or west longitude. "
98 	    "ASCII 'E' indicates east longitude, and 'W' is west "
99 	    "longitude."), ESL_GPS},
100 	{EXIF_TAG_GPS_LONGITUDE, "GPSLongitude", N_("Longitude"),
101 	 N_("Indicates the longitude. The longitude is expressed as three "
102 	    "RATIONAL values giving the degrees, minutes, and seconds, "
103 	    "respectively. When degrees, minutes and seconds are expressed, "
104 	    "the format is ddd/1,mm/1,ss/1. When degrees and minutes are "
105 	    "used and, for example, fractions of minutes are given up to "
106 	    "two decimal places, the format is ddd/1,mmmm/100,0/1."),
107 	 ESL_GPS},
108 	{EXIF_TAG_GPS_ALTITUDE_REF, "GPSAltitudeRef", N_("Altitude Reference"),
109 	 N_("Indicates the altitude used as the reference altitude. If the "
110 	    "reference is sea level and the altitude is above sea level, 0 "
111 	    "is given. If the altitude is below sea level, a value of 1 is given "
112 	    "and the altitude is indicated as an absolute value in the "
113 	    "GPSAltitude tag. The reference unit is meters. Note that this tag "
114 	    "is BYTE type, unlike other reference tags."), ESL_GPS},
115 	{EXIF_TAG_GPS_ALTITUDE, "GPSAltitude", N_("Altitude"),
116 	 N_("Indicates the altitude based on the reference in GPSAltitudeRef. "
117 	    "Altitude is expressed as one RATIONAL value. The reference unit "
118 	    "is meters."), ESL_GPS},
119 	{EXIF_TAG_GPS_TIME_STAMP, "GPSTimeStamp", N_("GPS Time (Atomic Clock)"),
120          N_("Indicates the time as UTC (Coordinated Universal Time). "
121 	    "TimeStamp is expressed as three RATIONAL values giving "
122             "the hour, minute, and second."), ESL_GPS},
123 	{EXIF_TAG_GPS_SATELLITES, "GPSSatellites", N_("GPS Satellites"),
124          N_("Indicates the GPS satellites used for measurements. This "
125             "tag can be used to describe the number of satellites, their ID "
126             "number, angle of elevation, azimuth, SNR and other information "
127             "in ASCII notation. The format is not specified. If the GPS "
128             "receiver is incapable of taking measurements, value of the tag "
129             "shall be set to NULL."), ESL_GPS},
130 	{EXIF_TAG_GPS_STATUS, "GPSStatus", N_("GPS Receiver Status"),
131          N_("Indicates the status of the GPS receiver when the image is "
132             "recorded. 'A' means measurement is in progress, and 'V' means "
133             "the measurement is Interoperability."), ESL_GPS},
134 	{EXIF_TAG_GPS_MEASURE_MODE, "GPSMeasureMode", N_("GPS Measurement Mode"),
135          N_("Indicates the GPS measurement mode. '2' means "
136             "two-dimensional measurement and '3' means three-dimensional "
137             "measurement is in progress."), ESL_GPS},
138 	{EXIF_TAG_GPS_DOP, "GPSDOP", N_("Measurement Precision"),
139          N_("Indicates the GPS DOP (data degree of precision). An HDOP "
140             "value is written during two-dimensional measurement, and PDOP "
141             "during three-dimensional measurement."), ESL_GPS},
142 	{EXIF_TAG_GPS_SPEED_REF, "GPSSpeedRef", N_("Speed Unit"),
143          N_("Indicates the unit used to express the GPS receiver speed "
144             "of movement. 'K', 'M' and 'N' represent kilometers per hour, "
145             "miles per hour, and knots."), ESL_GPS},
146 	{EXIF_TAG_GPS_SPEED, "GPSSpeed", N_("Speed of GPS Receiver"),
147 	 N_("Indicates the speed of GPS receiver movement."), ESL_GPS},
148 	{EXIF_TAG_GPS_TRACK_REF, "GPSTrackRef", N_("Reference for direction of movement"),
149          N_("Indicates the reference for giving the direction of GPS "
150             "receiver movement. 'T' denotes true direction and 'M' is "
151             "magnetic direction."), ESL_GPS},
152 	{EXIF_TAG_GPS_TRACK, "GPSTrack", N_("Direction of Movement"),
153          N_("Indicates the direction of GPS receiver movement. The range "
154             "of values is from 0.00 to 359.99."), ESL_GPS},
155 	{EXIF_TAG_GPS_IMG_DIRECTION_REF, "GPSImgDirectionRef", N_("GPS Image Direction Reference"),
156 	 N_("Indicates the reference for giving the direction of the image when it is captured. "
157 	    "'T' denotes true direction and 'M' is magnetic direction."), ESL_GPS},
158 	{EXIF_TAG_GPS_IMG_DIRECTION, "GPSImgDirection", N_("GPS Image Direction"),
159 	 N_("Indicates the direction of the image when it was captured. The range of values is "
160 	    "from 0.00 to 359.99."), ESL_GPS},
161 	{EXIF_TAG_GPS_MAP_DATUM, "GPSMapDatum", N_("Geodetic Survey Data Used"),
162          N_("Indicates the geodetic survey data used by the GPS "
163             "receiver. If the survey data is restricted to Japan, the value "
164             "of this tag is 'TOKYO' or 'WGS-84'. If a GPS Info tag is "
165             "recorded, it is strongly recommended that this tag be recorded."), ESL_GPS},
166 	{EXIF_TAG_GPS_DEST_LATITUDE_REF, "GPSDestLatitudeRef", N_("Reference For Latitude of Destination"),
167          N_("Indicates whether the latitude of the destination point is "
168             "north or south latitude. The ASCII value 'N' indicates north "
169             "latitude, and 'S' is south latitude."), ESL_GPS},
170 	{EXIF_TAG_GPS_DEST_LATITUDE, "GPSDestLatitude", N_("Latitude of Destination"),
171          N_("Indicates the latitude of the destination point. The "
172             "latitude is expressed as three RATIONAL values giving the "
173             "degrees, minutes, and seconds, respectively. If latitude is "
174             "expressed as degrees, minutes and seconds, a typical format "
175             "would be dd/1,mm/1,ss/1. When degrees and minutes are used and, "
176             "for example, fractions of minutes are given up to two decimal "
177             "places, the format would be dd/1,mmmm/100,0/1."), ESL_GPS},
178 	{EXIF_TAG_GPS_DEST_LONGITUDE_REF, "GPSDestLongitudeRef", N_("Reference for Longitude of Destination"),
179          N_("Indicates whether the longitude of the destination point is "
180             "east or west longitude. ASCII 'E' indicates east longitude, and "
181             "'W' is west longitude."), ESL_GPS},
182 	{EXIF_TAG_GPS_DEST_LONGITUDE, "GPSDestLongitude", N_("Longitude of Destination"),
183          N_("Indicates the longitude of the destination point. The "
184             "longitude is expressed as three RATIONAL values giving the "
185             "degrees, minutes, and seconds, respectively. If longitude is "
186             "expressed as degrees, minutes and seconds, a typical format "
187             "would be ddd/1,mm/1,ss/1. When degrees and minutes are used "
188             "and, for example, fractions of minutes are given up to two "
189             "decimal places, the format would be ddd/1,mmmm/100,0/1."),
190          ESL_GPS},
191 	{EXIF_TAG_GPS_DEST_BEARING_REF, "GPSDestBearingRef", N_("Reference for Bearing of Destination"),
192          N_("Indicates the reference used for giving the bearing to "
193             "the destination point. 'T' denotes true direction and 'M' is "
194             "magnetic direction."), ESL_GPS},
195 	{EXIF_TAG_GPS_DEST_BEARING, "GPSDestBearing", N_("Bearing of Destination"),
196          N_("Indicates the bearing to the destination point. The range "
197             "of values is from 0.00 to 359.99."), ESL_GPS},
198 	{EXIF_TAG_GPS_DEST_DISTANCE_REF, "GPSDestDistanceRef", N_("Reference for Distance to Destination"),
199          N_("Indicates the unit used to express the distance to the "
200             "destination point. 'K', 'M' and 'N' represent kilometers, miles "
201             "and nautical miles."), ESL_GPS},
202 	{EXIF_TAG_GPS_DEST_DISTANCE, "GPSDestDistance", N_("Distance to Destination"),
203 	 N_("Indicates the distance to the destination point."), ESL_GPS},
204 	{EXIF_TAG_GPS_PROCESSING_METHOD, "GPSProcessingMethod", N_("Name of GPS Processing Method"),
205          N_("A character string recording the name of the method used "
206             "for location finding. The first byte indicates the character "
207             "code used, and this is followed by the name "
208             "of the method. Since the Type is not ASCII, NULL termination is "
209             "not necessary."), ESL_GPS},
210 	{EXIF_TAG_GPS_AREA_INFORMATION, "GPSAreaInformation", N_("Name of GPS Area"),
211          N_("A character string recording the name of the GPS area. The "
212             "first byte indicates the character code used, "
213             "and this is followed by the name of the GPS area. Since "
214             "the Type is not ASCII, NULL termination is not necessary."), ESL_GPS},
215 	{EXIF_TAG_GPS_DATE_STAMP, "GPSDateStamp", N_("GPS Date"),
216          N_("A character string recording date and time information "
217             "relative to UTC (Coordinated Universal Time). The format is "
218             "\"YYYY:MM:DD\". The length of the string is 11 bytes including "
219             "NULL."), ESL_GPS},
220 	{EXIF_TAG_GPS_DIFFERENTIAL, "GPSDifferential", N_("GPS Differential Correction"),
221          N_("Indicates whether differential correction is applied to the "
222             "GPS receiver."), ESL_GPS},
223 	{EXIF_TAG_GPS_H_POSITIONING_ERROR, "GPSHPositioningError", N_("GPS Horizontal Positioning Error"),
224          N_("Indicates the horizontal positioning errors in meters. This is "
225             "expressed as one RATIONAL value."), ESL_GPS},
226 	/* Not in EXIF 2.2 */
227 	{EXIF_TAG_NEW_SUBFILE_TYPE, "NewSubfileType",
228 	 N_("New Subfile Type"), N_("A general indication of the kind of data "
229 	    "contained in this subfile."),
230 	 ESL_UNKNOWN},
231 	{EXIF_TAG_IMAGE_WIDTH, "ImageWidth", N_("Image Width"),
232 	 N_("The number of columns of image data, equal to the number of "
233 	    "pixels per row. In JPEG compressed data a JPEG marker is "
234 	    "used instead of this tag."),
235 	 { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
236 	{EXIF_TAG_IMAGE_LENGTH, "ImageLength", N_("Image Length"),
237 	 N_("The number of rows of image data. In JPEG compressed data a "
238 	    "JPEG marker is used instead of this tag."),
239 	 { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
240 	{EXIF_TAG_BITS_PER_SAMPLE, "BitsPerSample", N_("Bits per Sample"),
241 	 N_("The number of bits per image component. In this standard each "
242 	    "component of the image is 8 bits, so the value for this "
243 	    "tag is 8. See also <SamplesPerPixel>. In JPEG compressed data "
244 	    "a JPEG marker is used instead of this tag."),
245 	 { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
246 	{EXIF_TAG_COMPRESSION, "Compression", N_("Compression"),
247 	 N_("The compression scheme used for the image data. When a "
248 	    "primary image is JPEG compressed, this designation is "
249 	    "not necessary and is omitted. When thumbnails use JPEG "
250 	    "compression, this tag value is set to 6."),
251 	 { ESL_MMMN, ESL_MMMM, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
252 	{EXIF_TAG_PHOTOMETRIC_INTERPRETATION, "PhotometricInterpretation",
253 	 N_("Photometric Interpretation"),
254 	 N_("The pixel composition. In JPEG compressed data a JPEG "
255 	    "marker is used instead of this tag."),
256 	 { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
257 	/* Not in EXIF 2.2 */
258 	{EXIF_TAG_FILL_ORDER, "FillOrder", N_("Fill Order"), "", ESL_UNKNOWN},
259 	/* Not in EXIF 2.2 */
260 	{EXIF_TAG_DOCUMENT_NAME, "DocumentName", N_("Document Name"), "",
261 	 ESL_UNKNOWN},
262 	{EXIF_TAG_IMAGE_DESCRIPTION, "ImageDescription",
263 	 N_("Image Description"),
264 	 N_("A character string giving the title of the image. It may be "
265 	    "a comment such as \"1988 company picnic\" or "
266 	    "the like. Two-bytes character codes cannot be used. "
267 	    "When a 2-bytes code is necessary, the Exif Private tag "
268 	    "<UserComment> is to be used."),
269 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
270 	{EXIF_TAG_MAKE, "Make", N_("Manufacturer"),
271 	 N_("The manufacturer of the recording "
272 	    "equipment. This is the manufacturer of the DSC, scanner, "
273 	    "video digitizer or other equipment that generated the "
274 	    "image. When the field is left blank, it is treated as "
275 	    "unknown."),
276 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
277 	{EXIF_TAG_MODEL, "Model", N_("Model"),
278 	 N_("The model name or model number of the equipment. This is the "
279 	    "model name or number of the DSC, scanner, video digitizer "
280 	    "or other equipment that generated the image. When the field "
281 	    "is left blank, it is treated as unknown."),
282 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
283 	{EXIF_TAG_STRIP_OFFSETS, "StripOffsets", N_("Strip Offsets"),
284 	 N_("For each strip, the byte offset of that strip. It is "
285 	    "recommended that this be selected so the number of strip "
286 	    "bytes does not exceed 64 Kbytes. With JPEG compressed "
287 	    "data this designation is not needed and is omitted. See also "
288 	    "<RowsPerStrip> and <StripByteCounts>."),
289 	 { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
290 	{EXIF_TAG_ORIENTATION, "Orientation", N_("Orientation"),
291 	 N_("The image orientation viewed in terms of rows and columns."),
292 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
293 	{EXIF_TAG_SAMPLES_PER_PIXEL, "SamplesPerPixel",
294 	 N_("Samples per Pixel"),
295 	 N_("The number of components per pixel. Since this standard applies "
296 	    "to RGB and YCbCr images, the value set for this tag is 3. "
297 	    "In JPEG compressed data a JPEG marker is used instead of this "
298 	    "tag."),
299 	 { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
300 	{EXIF_TAG_ROWS_PER_STRIP, "RowsPerStrip", N_("Rows per Strip"),
301 	 N_("The number of rows per strip. This is the number of rows "
302 	    "in the image of one strip when an image is divided into "
303 	    "strips. With JPEG compressed data this designation is not "
304 	    "needed and is omitted. See also <StripOffsets> and "
305 	    "<StripByteCounts>."),
306 	 { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
307 	{EXIF_TAG_STRIP_BYTE_COUNTS, "StripByteCounts", N_("Strip Byte Count"),
308 	 N_("The total number of bytes in each strip. With JPEG compressed "
309 	    "data this designation is not needed and is omitted."),
310 	 { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
311 	{EXIF_TAG_X_RESOLUTION, "XResolution", N_("X-Resolution"),
312 	 N_("The number of pixels per <ResolutionUnit> in the <ImageWidth> "
313 	    "direction. When the image resolution is unknown, 72 [dpi] "
314 	    "is designated."),
315 	 { ESL_MMMM, ESL_MMMM, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
316 	{EXIF_TAG_Y_RESOLUTION, "YResolution", N_("Y-Resolution"),
317 	 N_("The number of pixels per <ResolutionUnit> in the <ImageLength> "
318 	    "direction. The same value as <XResolution> is designated."),
319 	 { ESL_MMMM, ESL_MMMM, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
320 	{EXIF_TAG_PLANAR_CONFIGURATION, "PlanarConfiguration",
321 	 N_("Planar Configuration"),
322 	 N_("Indicates whether pixel components are recorded in a chunky "
323 	    "or planar format. In JPEG compressed files a JPEG marker "
324 	    "is used instead of this tag. If this field does not exist, "
325 	    "the TIFF default of 1 (chunky) is assumed."),
326 	 { ESL_OMON, ESL_OMON, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
327 	{EXIF_TAG_RESOLUTION_UNIT, "ResolutionUnit", N_("Resolution Unit"),
328 	 N_("The unit for measuring <XResolution> and <YResolution>. The same "
329 	    "unit is used for both <XResolution> and <YResolution>. If "
330 	    "the image resolution is unknown, 2 (inches) is designated."),
331 	 { ESL_MMMM, ESL_MMMM, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
332 	{EXIF_TAG_TRANSFER_FUNCTION, "TransferFunction",
333 	 N_("Transfer Function"),
334 	 N_("A transfer function for the image, described in tabular style. "
335 	    "Normally this tag is not necessary, since color space is "
336 	    "specified in the color space information tag (<ColorSpace>)."),
337 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
338 	{EXIF_TAG_SOFTWARE, "Software", N_("Software"),
339 	 N_("This tag records the name and version of the software or "
340 	    "firmware of the camera or image input device used to "
341 	    "generate the image. The detailed format is not specified, but "
342 	    "it is recommended that the example shown below be "
343 	    "followed. When the field is left blank, it is treated as "
344 	    "unknown."),
345 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
346 	{EXIF_TAG_DATE_TIME, "DateTime", N_("Date and Time"),
347 	 N_("The date and time of image creation. In this standard "
348 	    "(EXIF-2.1) it is the date and time the file was changed."),
349 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
350 	{EXIF_TAG_ARTIST, "Artist", N_("Artist"),
351 	 N_("This tag records the name of the camera owner, photographer or "
352 	    "image creator. The detailed format is not specified, but it is "
353 	    "recommended that the information be written as in the example "
354 	    "below for ease of Interoperability. When the field is "
355 	    "left blank, it is treated as unknown."),
356 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
357 	{EXIF_TAG_WHITE_POINT, "WhitePoint", N_("White Point"),
358 	 N_("The chromaticity of the white point of the image. Normally "
359 	    "this tag is not necessary, since color space is specified "
360 	    "in the color space information tag (<ColorSpace>)."),
361 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
362 	{EXIF_TAG_PRIMARY_CHROMATICITIES, "PrimaryChromaticities",
363 	 N_("Primary Chromaticities"),
364 	 N_("The chromaticity of the three primary colors of the image. "
365 	    "Normally this tag is not necessary, since color space is "
366 	    "specified in the color space information tag (<ColorSpace>)."),
367 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
368 	/* Not in EXIF 2.2 */
369 	{EXIF_TAG_SUB_IFDS, "SubIFDs", "SubIFD Offsets", N_("Defined by Adobe Corporation "
370 	    "to enable TIFF Trees within a TIFF file."), ESL_UNKNOWN},
371 	/* Not in EXIF 2.2 */
372 	{EXIF_TAG_TRANSFER_RANGE, "TransferRange", N_("Transfer Range"), "",
373 	 ESL_UNKNOWN},
374 	/* Not in EXIF 2.2 */
375 	{EXIF_TAG_JPEG_PROC, "JPEGProc", "JPEGProc", "", ESL_UNKNOWN },
376 	/* Same as JPEGPro */
377 	{EXIF_TAG_JPEG_PROC, "PhotoMode", "PhotoMode", "", ESL_UNKNOWN},
378 	{EXIF_TAG_JPEG_INTERCHANGE_FORMAT, "JPEGInterchangeFormat",
379 	 N_("JPEG Interchange Format"),
380 	 N_("The offset to the start byte (SOI) of JPEG compressed "
381 	    "thumbnail data. This is not used for primary image "
382 	    "JPEG data."),
383 	 { ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
384 	{EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH,
385 	 "JPEGInterchangeFormatLength", N_("JPEG Interchange Format Length"),
386 	 N_("The number of bytes of JPEG compressed thumbnail data. This "
387 	    "is not used for primary image JPEG data. JPEG thumbnails "
388 	    "are not divided but are recorded as a continuous JPEG "
389 	    "bitstream from SOI to EOI. Appn and COM markers should "
390 	    "not be recorded. Compressed thumbnails must be recorded in no "
391 	    "more than 64 Kbytes, including all other data to be "
392 	    "recorded in APP1."),
393 	 { ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
394 	{EXIF_TAG_YCBCR_COEFFICIENTS, "YCbCrCoefficients",
395 	 N_("YCbCr Coefficients"),
396 	 N_("The matrix coefficients for transformation from RGB to YCbCr "
397 	    "image data. No default is given in TIFF; but here the "
398 	    "value given in \"Color Space Guidelines\", is used "
399 	    "as the default. The color space is declared in a "
400 	    "color space information tag, with the default being the value "
401 	    "that gives the optimal image characteristics "
402 	    "Interoperability this condition."),
403 	 { ESL_NNOO, ESL_NNOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
404 	{EXIF_TAG_YCBCR_SUB_SAMPLING, "YCbCrSubSampling",
405 	 N_("YCbCr Sub-Sampling"),
406 	 N_("The sampling ratio of chrominance components in relation to the "
407 	    "luminance component. In JPEG compressed data a JPEG marker "
408 	    "is used instead of this tag."),
409 	 { ESL_NNMN, ESL_NNMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
410 	{EXIF_TAG_YCBCR_POSITIONING, "YCbCrPositioning",
411 	 N_("YCbCr Positioning"),
412 	 N_("The position of chrominance components in relation to the "
413 	    "luminance component. This field is designated only for "
414 	    "JPEG compressed data or uncompressed YCbCr data. The TIFF "
415 	    "default is 1 (centered); but when Y:Cb:Cr = 4:2:2 it is "
416 	    "recommended in this standard that 2 (co-sited) be used to "
417 	    "record data, in order to improve the image quality when viewed "
418 	    "on TV systems. When this field does not exist, the reader shall "
419 	    "assume the TIFF default. In the case of Y:Cb:Cr = 4:2:0, the "
420 	    "TIFF default (centered) is recommended. If the reader "
421 	    "does not have the capability of supporting both kinds of "
422 	    "<YCbCrPositioning>, it shall follow the TIFF default regardless "
423 	    "of the value in this field. It is preferable that readers "
424 	    "be able to support both centered and co-sited positioning."),
425 	 { ESL_NNMM, ESL_NNOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
426 	{EXIF_TAG_REFERENCE_BLACK_WHITE, "ReferenceBlackWhite",
427 	 N_("Reference Black/White"),
428 	 N_("The reference black point value and reference white point "
429 	    "value. No defaults are given in TIFF, but the values "
430 	    "below are given as defaults here. The color space is declared "
431 	    "in a color space information tag, with the default "
432 	    "being the value that gives the optimal image characteristics "
433 	    "Interoperability these conditions."),
434 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
435 	/* Not in EXIF 2.2 */
436 	{EXIF_TAG_XML_PACKET, "XMLPacket", N_("XML Packet"), N_("XMP Metadata"),
437 	 ESL_UNKNOWN},
438 	/* Not in EXIF 2.2 */
439 	{EXIF_TAG_RELATED_IMAGE_FILE_FORMAT, "RelatedImageFileFormat",
440 	 "RelatedImageFileFormat", "", ESL_UNKNOWN},
441 	/* Not in EXIF 2.2 */
442 	{EXIF_TAG_RELATED_IMAGE_WIDTH, "RelatedImageWidth",
443 	 "RelatedImageWidth", "", ESL_UNKNOWN},
444 	/* Not in EXIF 2.2 */
445 	{EXIF_TAG_RELATED_IMAGE_LENGTH, "RelatedImageLength",
446 	 "RelatedImageLength", "", ESL_UNKNOWN},
447 	/* Not in EXIF 2.2 */
448 	{EXIF_TAG_CFA_REPEAT_PATTERN_DIM, "CFARepeatPatternDim",
449 	 "CFARepeatPatternDim", "", ESL_UNKNOWN},
450 	/* Not in EXIF 2.2 */
451 	{EXIF_TAG_CFA_PATTERN, "CFAPattern2",
452 	 N_("CFA Pattern"),
453 	 N_("Indicates the color filter array (CFA) geometric pattern of the "
454 	    "image sensor when a one-chip color area sensor is used. "
455 	    "It does not apply to all sensing methods."), ESL_UNKNOWN},
456 	/* Not in EXIF 2.2 */
457 	{EXIF_TAG_BATTERY_LEVEL, "BatteryLevel", N_("Battery Level"), "",
458 	 ESL_UNKNOWN},
459 	{EXIF_TAG_COPYRIGHT, "Copyright", N_("Copyright"),
460 	 N_("Copyright information. In this standard the tag is used to "
461 	    "indicate both the photographer and editor copyrights. It is "
462 	    "the copyright notice of the person or organization claiming "
463 	    "rights to the image. The Interoperability copyright "
464 	    "statement including date and rights should be written in this "
465 	    "field; e.g., \"Copyright, John Smith, 19xx. All rights "
466 	    "reserved.\". In this standard the field records both the "
467 	    "photographer and editor copyrights, with each recorded in a "
468 	    "separate part of the statement. When there is a clear "
469 	    "distinction between the photographer and editor copyrights, "
470 	    "these are to be written in the order of photographer followed "
471 	    "by editor copyright, separated by NULL (in this case, "
472 	    "since the statement also ends with a NULL, there are two NULL "
473 	    "codes) (see example 1). When only the photographer is given, "
474 	    "it is terminated by one NULL code (see example 2). When only "
475 	    "the editor copyright is given, "
476 	    "the photographer copyright part consists of one space followed "
477 	    "by a terminating NULL code, then the editor copyright is given "
478 	    "(see example 3). When the field is left blank, it is treated "
479 	    "as unknown."),
480 	 { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
481 	{EXIF_TAG_EXPOSURE_TIME, "ExposureTime", N_("Exposure Time"),
482 	 N_("Exposure time, given in seconds (sec)."),
483 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
484 	{EXIF_TAG_FNUMBER, "FNumber", N_("F-Number"),
485 	 N_("The F number."),
486 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
487 	/* Not in EXIF 2.2 */
488 	{EXIF_TAG_IPTC_NAA, "IPTC/NAA", "IPTC/NAA", "", ESL_UNKNOWN},
489 	/* Not in EXIF 2.2 */
490 	{EXIF_TAG_IMAGE_RESOURCES, "ImageResources", N_("Image Resources Block"), "",
491 	 ESL_UNKNOWN},
492 	{EXIF_TAG_EXIF_IFD_POINTER, "ExifIfdPointer", "ExifIFDPointer",
493 	 N_("A pointer to the Exif IFD. Interoperability, Exif IFD has the "
494 	    "same structure as that of the IFD specified in TIFF. "
495 	    "ordinarily, however, it does not contain image data as in "
496 	    "the case of TIFF."),
497 	 { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
498 	/* Not in EXIF 2.2 */
499 	{EXIF_TAG_INTER_COLOR_PROFILE, "InterColorProfile",
500 	 "InterColorProfile", "", ESL_UNKNOWN},
501 	{EXIF_TAG_EXPOSURE_PROGRAM, "ExposureProgram", N_("Exposure Program"),
502 	 N_("The class of the program used by the camera to set exposure "
503 	    "when the picture is taken."),
504 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
505 	{EXIF_TAG_SPECTRAL_SENSITIVITY, "SpectralSensitivity",
506 	 N_("Spectral Sensitivity"),
507 	 N_("Indicates the spectral sensitivity of each channel of the "
508 	    "camera used. The tag value is an ASCII string compatible "
509 	    "with the standard developed by the ASTM Technical Committee."),
510 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
511 	{EXIF_TAG_GPS_INFO_IFD_POINTER, "GPSInfoIFDPointer",
512 	 N_("GPS Info IFD Pointer"),
513 	 N_("A pointer to the GPS Info IFD. The "
514 	    "Interoperability structure of the GPS Info IFD, like that of "
515 	    "Exif IFD, has no image data."),
516 	 { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
517 	{EXIF_TAG_ISO_SPEED_RATINGS, "ISOSpeedRatings",
518 	 N_("ISO Speed Ratings"),
519 	 N_("Indicates the ISO Speed and ISO Latitude of the camera or "
520 	    "input device as specified in ISO 12232."),
521 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
522 	{EXIF_TAG_ISO_SPEED_RATINGS, "PhotographicSensitivity",
523 	 N_("Photographic Sensitivity"),
524 	 N_("This tag indicates the sensitivity of the camera or input device when the image was shot."),
525 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
526 	{EXIF_TAG_OECF, "OECF", N_("Opto-Electronic Conversion Function"),
527 	 N_("Indicates the Opto-Electronic Conversion Function (OECF) "
528 	    "specified in ISO 14524. <OECF> is the relationship between "
529 	    "the camera optical input and the image values."),
530 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
531 	/* Not in EXIF 2.2 */
532 	{EXIF_TAG_TIME_ZONE_OFFSET, "TimeZoneOffset", N_("Time Zone Offset"),
533 	 N_("Encodes time zone of camera clock relative to GMT."),
534 	 ESL_UNKNOWN},
535 	{EXIF_TAG_SENSITIVITY_TYPE, "SensitivityType", N_("Sensitivity Type"),
536 	 N_("The SensitivityType tag indicates which one of the parameters of "
537 	 	"ISO12232 is the PhotographicSensitivity tag. Although it is an optional "
538 		"tag, it should be recorded when a PhotographicSensitivity tag is recorded. "
539 		"Value = 4, 5, 6, or 7 may be used in case that the values of plural parameters "
540 		"are the same."),
541 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
542 	{EXIF_TAG_STANDARD_OUTPUT_SENSITIVITY, "StandardOutputSensitivity", N_("Standard Output Sensitivity"),
543 	 "",
544 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
545 	{EXIF_TAG_RECOMMENDED_EXPOSURE_INDEX, "RecommendedExposureIndex",
546 	 N_("Recommended Exposure Index"),
547 	 "",
548 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
549 	{EXIF_TAG_ISO_SPEED, "ISOSpeed",
550 	 N_("ISO Speed"),
551 	 "",
552 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
553 	{EXIF_TAG_ISO_SPEEDLatitudeYYY, "ISOSpeedLatitudeyyy",
554 	 N_("ISO Speed Latitude yyy"),
555 	 "",
556 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
557 	{EXIF_TAG_ISO_SPEEDLatitudeZZZ, "ISOSpeedLatitudezzz",
558 	 N_("ISO Speed Latitude zzz"),
559 	 "",
560 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
561 	{EXIF_TAG_EXIF_VERSION, "ExifVersion", N_("Exif Version"),
562 	 N_("The version of this standard supported. Nonexistence of this "
563 	    "field is taken to mean nonconformance to the standard."),
564 	 { ESL_NNNN, ESL_NNNN, ESL_MMMM, ESL_NNNN, ESL_NNNN } },
565 	{EXIF_TAG_DATE_TIME_ORIGINAL, "DateTimeOriginal",
566 	 N_("Date and Time (Original)"),
567 	 N_("The date and time when the original image data was generated. "
568 	    "For a digital still camera "
569 	    "the date and time the picture was taken are recorded."),
570 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
571 	{EXIF_TAG_DATE_TIME_DIGITIZED, "DateTimeDigitized",
572 	 N_("Date and Time (Digitized)"),
573 	 N_("The date and time when the image was stored as digital data."),
574 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
575 	/* EXIF 2.32 */
576 	{EXIF_TAG_OFFSET_TIME, "OffsetTime", N_("Offset Time For DateTime"),
577 	 N_("A tag used to record the offset from UTC (the time difference from Universal Time Coordinated including daylight saving time) of the time of DateTime tag. The format when recording the offset is \"+|-HH:MM\". The part of \"+|-\" shall be recorded as \"+\" or \"-\". When the offset are unknown, all the character spaces except colons (\":\")should be filled with blank characters, or else the Interoperability field should be filled with blank characters. The character string length is 7 Bytes including NULL for termination. When the field is left blank, it is treated as unknown."),
578 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
579 	/* EXIF 2.32 */
580 	{EXIF_TAG_OFFSET_TIME_ORIGINAL, "OffsetTimeOriginal", N_("Offset Time For DateTimeOriginal"),
581 	 N_("A tag used to record the offset from UTC (the time difference from Universal Time Coordinated including daylight saving  time)  of  the time  of  DateTimeOriginal  tag.  The  format  when  recording  the  offset  is \"+|-HH:MM\". The part of \"+|-\" shall be recorded as \"+\" or \"-\". When the offset are unknown, all the character spaces except colons (\":\")should be filled with blank characters, or else the Interoperability field should be filled with blank characters. The character string length is 7 Bytes including NULL for termination. When the field is left blank, it is treated as unknown."),
582 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
583 	/* EXIF 2.32 */
584 	{EXIF_TAG_OFFSET_TIME_DIGITIZED, "OffsetTimeDigitized", N_("Offset Time For DateTimeDigitized"),
585 	 N_("A tag used to record the offset from UTC (the time difference from Universal Time Coordinated including daylight  saving  time)  of  the time  of  DateTimeDigitized  tag.  The  format  when  recording  the  offset  is \"+|-HH:MM\". The part of \"+|-\" shall be recorded as \"+\" or \"-\". When the offset are unknown, all the character spaces except colons (\":\")should be filled with blank characters, or else the Interoperability field should be filled with blank characters. The character string length is 7 Bytes including NULL for termination. When the field is left blank, it is treated as unknown."),
586 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
587 	{EXIF_TAG_COMPONENTS_CONFIGURATION, "ComponentsConfiguration",
588 	 N_("Components Configuration"),
589 	 N_("Information specific to compressed data. The channels of "
590 	    "each component are arranged in order from the 1st "
591 	    "component to the 4th. For uncompressed data the data "
592 	    "arrangement is given in the <PhotometricInterpretation> tag. "
593 	    "However, since <PhotometricInterpretation> can only "
594 	    "express the order of Y, Cb and Cr, this tag is provided "
595 	    "for cases when compressed data uses components other than "
596 	    "Y, Cb, and Cr and to enable support of other sequences."),
597 	 { ESL_NNNN, ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN } },
598 	{EXIF_TAG_COMPRESSED_BITS_PER_PIXEL, "CompressedBitsPerPixel",
599 	 N_("Compressed Bits per Pixel"),
600 	 N_("Information specific to compressed data. The compression mode "
601 	    "used for a compressed image is indicated in unit bits "
602 	    "per pixel."),
603 	 { ESL_NNNN, ESL_NNNN, ESL_NNNO, ESL_NNNN, ESL_NNNN } },
604 	{EXIF_TAG_SHUTTER_SPEED_VALUE, "ShutterSpeedValue", N_("Shutter Speed"),
605 	 N_("Shutter speed. The unit is the APEX (Additive System of "
606 	    "Photographic Exposure) setting."),
607 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
608 	{EXIF_TAG_APERTURE_VALUE, "ApertureValue", N_("Aperture"),
609 	 N_("The lens aperture. The unit is the APEX value."),
610 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
611 	{EXIF_TAG_BRIGHTNESS_VALUE, "BrightnessValue", N_("Brightness"),
612 	 N_("The value of brightness. The unit is the APEX value. "
613 	    "Ordinarily it is given in the range of -99.99 to 99.99."),
614 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
615 	{EXIF_TAG_EXPOSURE_BIAS_VALUE, "ExposureBiasValue",
616 	 N_("Exposure Bias"),
617 	 N_("The exposure bias. The units is the APEX value. Ordinarily "
618 	    "it is given in the range of -99.99 to 99.99."),
619 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
620 	{EXIF_TAG_MAX_APERTURE_VALUE, "MaxApertureValue", N_("Maximum Aperture Value"),
621 	 N_("The smallest F number of the lens. The unit is the APEX value. "
622 	    "Ordinarily it is given in the range of 00.00 to 99.99, "
623 	    "but it is not limited to this range."),
624 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
625 	{EXIF_TAG_SUBJECT_DISTANCE, "SubjectDistance",
626 	 N_("Subject Distance"),
627 	 N_("The distance to the subject, given in meters."),
628 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
629 	{EXIF_TAG_METERING_MODE, "MeteringMode", N_("Metering Mode"),
630 	 N_("The metering mode."),
631 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
632 	{EXIF_TAG_LIGHT_SOURCE, "LightSource", N_("Light Source"),
633 	 N_("The kind of light source."),
634 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
635 	{EXIF_TAG_FLASH, "Flash", N_("Flash"),
636 	 N_("This tag is recorded when an image is taken using a strobe "
637 	    "light (flash)."),
638 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
639 	{EXIF_TAG_FOCAL_LENGTH, "FocalLength", N_("Focal Length"),
640 	 N_("The actual focal length of the lens, in mm. Conversion is not "
641 	    "made to the focal length of a 35 mm film camera."),
642 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
643 	{EXIF_TAG_SUBJECT_AREA, "SubjectArea", N_("Subject Area"),
644 	 N_("This tag indicates the location and area of the main subject "
645 	    "in the overall scene."),
646 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
647 	/* Not in EXIF 2.2 */
648 	{EXIF_TAG_TIFF_EP_STANDARD_ID, "TIFF/EPStandardID", N_("TIFF/EP Standard ID"), "",
649 	 ESL_UNKNOWN},
650 	{EXIF_TAG_MAKER_NOTE, "MakerNote", N_("Maker Note"),
651 	 N_("A tag for manufacturers of Exif writers to record any desired "
652 	    "information. The contents are up to the manufacturer."),
653 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
654 	{EXIF_TAG_USER_COMMENT, "UserComment", N_("User Comment"),
655 	 N_("A tag for Exif users to write keywords or comments on the image "
656 	    "besides those in <ImageDescription>, and without the "
657 	    "character code limitations of the <ImageDescription> tag. The "
658 	    "character code used in the <UserComment> tag is identified "
659 	    "based on an ID code in a fixed 8-byte area at the start of "
660 	    "the tag data area. The unused portion of the area is padded "
661 	    "with NULL (\"00.h\"). ID codes are assigned by means of "
662 	    "registration. The designation method and references for each "
663 	    "character code are defined in the specification. The value of "
664 	    "CountN is determined based on the 8 bytes in the character code "
665 	    "area and the number of bytes in the user comment part. Since "
666 	    "the TYPE is not ASCII, NULL termination is not necessary. "
667 	    "The ID code for the <UserComment> area may be a Defined code "
668 	    "such as JIS or ASCII, or may be Undefined. The Undefined name "
669 	    "is UndefinedText, and the ID code is filled with 8 bytes of all "
670 	    "\"NULL\" (\"00.H\"). An Exif reader that reads the "
671 	    "<UserComment> tag must have a function for determining the "
672 	    "ID code. This function is not required in Exif readers that "
673 	    "do not use the <UserComment> tag. "
674 	    "When a <UserComment> area is set aside, it is recommended that "
675 	    "the ID code be ASCII and that the following user comment "
676 	    "part be filled with blank characters [20.H]."),
677 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
678 	{EXIF_TAG_SUB_SEC_TIME, "SubsecTime", N_("Sub-second Time"),
679 	 N_("A tag used to record fractions of seconds for the "
680 	    "<DateTime> tag."),
681 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
682 	{EXIF_TAG_SUB_SEC_TIME_ORIGINAL, "SubSecTimeOriginal",
683 	 N_("Sub-second Time (Original)"),
684 	 N_("A tag used to record fractions of seconds for the "
685 	    "<DateTimeOriginal> tag."),
686 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
687 	{EXIF_TAG_SUB_SEC_TIME_ORIGINAL, "SubsecTimeOriginal",
688 	 N_("Sub-second Time (Original)"),
689 	 N_("A tag used to record fractions of seconds for the "
690 	    "<DateTimeOriginal> tag."),
691 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
692 	{EXIF_TAG_SUB_SEC_TIME_DIGITIZED, "SubSecTimeDigitized",
693 	 N_("Sub-second Time (Digitized)"),
694 	 N_("A tag used to record fractions of seconds for the "
695 	    "<DateTimeDigitized> tag."),
696 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
697 	{EXIF_TAG_SUB_SEC_TIME_DIGITIZED, "SubsecTimeDigitized",
698 	 N_("Sub-second Time (Digitized)"),
699 	 N_("A tag used to record fractions of seconds for the "
700 	    "<DateTimeDigitized> tag."),
701 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
702 	/* Not in EXIF 2.2 (Microsoft extension) */
703 	{EXIF_TAG_XP_TITLE, "XPTitle", N_("XP Title"),
704 	 N_("A character string giving the title of the image, encoded in "
705 	    "UTF-16LE."),
706 	 { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
707 	/* Not in EXIF 2.2 (Microsoft extension) */
708 	{EXIF_TAG_XP_COMMENT, "XPComment", N_("XP Comment"),
709 	 N_("A character string containing a comment about the image, encoded "
710 	    "in UTF-16LE."),
711 	 { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
712 	/* Not in EXIF 2.2 (Microsoft extension) */
713 	{EXIF_TAG_XP_AUTHOR, "XPAuthor", N_("XP Author"),
714 	 N_("A character string containing the name of the image creator, "
715 	    "encoded in UTF-16LE."),
716 	 { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
717 	/* Not in EXIF 2.2 (Microsoft extension) */
718 	{EXIF_TAG_XP_KEYWORDS, "XPKeywords", N_("XP Keywords"),
719 	 N_("A character string containing key words describing the image, "
720 	    "encoded in UTF-16LE."),
721 	 { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
722 	/* Not in EXIF 2.2 (Microsoft extension) */
723 	{EXIF_TAG_XP_SUBJECT, "XPSubject", N_("XP Subject"),
724 	 N_("A character string giving the image subject, encoded in "
725 	    "UTF-16LE."),
726 	 { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
727 	{EXIF_TAG_FLASH_PIX_VERSION, "FlashpixVersion", "FlashPixVersion",
728 	 N_("The FlashPix format version supported by a FPXR file."),
729 	 { ESL_NNNN, ESL_NNNN, ESL_MMMM, ESL_NNNN, ESL_NNNN } },
730 	{EXIF_TAG_COLOR_SPACE, "ColorSpace", N_("Color Space"),
731 	 N_("The color space information tag is always "
732 	    "recorded as the color space specifier. Normally sRGB (=1) "
733 	    "is used to define the color space based on the PC monitor "
734 	    "conditions and environment. If a color space other than "
735 	    "sRGB is used, Uncalibrated (=FFFF.H) is set. Image data "
736 	    "recorded as Uncalibrated can be treated as sRGB when it is "
737 	    "converted to FlashPix."),
738 	 { ESL_NNNN, ESL_NNNN, ESL_MMMM, ESL_NNNN, ESL_NNNN } },
739 	{EXIF_TAG_PIXEL_X_DIMENSION, "PixelXDimension", N_("Pixel X Dimension"),
740 	 N_("Information specific to compressed data. When a "
741 	    "compressed file is recorded, the valid width of the "
742 	    "meaningful image must be recorded in this tag, whether or "
743 	    "not there is padding data or a restart marker. This tag "
744 	    "should not exist in an uncompressed file."),
745 	 { ESL_NNNN, ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN } },
746 	{EXIF_TAG_PIXEL_Y_DIMENSION, "PixelYDimension", N_("Pixel Y Dimension"),
747 	 N_("Information specific to compressed data. When a compressed "
748 	    "file is recorded, the valid height of the meaningful image "
749 	    "must be recorded in this tag, whether or not there is padding "
750 	    "data or a restart marker. This tag should not exist in an "
751 	    "uncompressed file. "
752 	    "Since data padding is unnecessary in the vertical direction, "
753 	    "the number of lines recorded in this valid image height tag "
754 	    "will in fact be the same as that recorded in the SOF."),
755 	 { ESL_NNNN, ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN } },
756 	{EXIF_TAG_RELATED_SOUND_FILE, "RelatedSoundFile",
757 	 N_("Related Sound File"),
758 	 N_("This tag is used to record the name of an audio file related "
759 	    "to the image data. The only relational information "
760 	    "recorded here is the Exif audio file name and extension (an "
761 	    "ASCII string consisting of 8 characters + '.' + 3 "
762 	    "characters). The path is not recorded. Stipulations on audio "
763 	    "and file naming conventions are defined in the specification. "
764 	    "When using this tag, audio files must be recorded in "
765 	    "conformance to the Exif audio format. Writers are also allowed "
766 	    "to store the data such as Audio within APP2 as FlashPix "
767 	    "extension stream data. "
768 	    "The mapping of Exif image files and audio files is done "
769 	    "in any of three ways, [1], [2] and [3]. If multiple files "
770 	    "are mapped to one file as in [2] or [3], the above "
771 	    "format is used to record just one audio file name. If "
772 	    "there are multiple audio files, the first recorded file is "
773 	    "given. In the case of [3], for example, for the "
774 	    "Exif image file \"DSC00001.JPG\" only  \"SND00001.WAV\" is "
775 	    "given as the related Exif audio file. When there are three "
776 	    "Exif audio files \"SND00001.WAV\", \"SND00002.WAV\" and "
777 	    "\"SND00003.WAV\", the Exif image file name for each of them, "
778 	    "\"DSC00001.JPG\", is indicated. By combining multiple "
779 	    "relational information, a variety of playback possibilities "
780 	    "can be supported. The method of using relational information "
781 	    "is left to the implementation on the playback side. Since this "
782 	    "information is an ASCII character string, it is terminated by "
783 	    "NULL. When this tag is used to map audio files, the relation "
784 	    "of the audio file to image data must also be indicated on the "
785 	    "audio file end."),
786 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
787 	{EXIF_TAG_INTEROPERABILITY_IFD_POINTER, "InteroperabilityIFDPointer",
788 	 N_("Interoperability IFD Pointer"),
789 	 N_("Interoperability IFD is composed of tags which stores the "
790 	    "information to ensure the Interoperability and pointed "
791 	    "by the following tag located in Exif IFD. "
792 	    "The Interoperability structure of Interoperability IFD is "
793 	    "the same as TIFF defined IFD structure "
794 	    "but does not contain the "
795 	    "image data characteristically compared with normal TIFF "
796 	    "IFD."),
797 	 { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
798 	{EXIF_TAG_FLASH_ENERGY, "FlashEnergy", N_("Flash Energy"),
799 	 N_("Indicates the strobe energy at the time the image is "
800 	    "captured, as measured in Beam Candle Power Seconds (BCPS)."),
801 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
802 	{EXIF_TAG_SPATIAL_FREQUENCY_RESPONSE, "SpatialFrequencyResponse",
803 	 N_("Spatial Frequency Response"),
804 	 N_("This tag records the camera or input device spatial frequency "
805 	    "table and SFR values in the direction of image width, "
806 	    "image height, and diagonal direction, as specified in ISO "
807 	    "12233."),
808 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
809 	{EXIF_TAG_FOCAL_PLANE_X_RESOLUTION, "FocalPlaneXResolution",
810 	 N_("Focal Plane X-Resolution"),
811 	 N_("Indicates the number of pixels in the image width (X) direction "
812 	    "per <FocalPlaneResolutionUnit> on the camera focal plane."),
813 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
814 	{EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION, "FocalPlaneYResolution",
815 	 N_("Focal Plane Y-Resolution"),
816 	 N_("Indicates the number of pixels in the image height (V) direction "
817 	    "per <FocalPlaneResolutionUnit> on the camera focal plane."),
818 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
819 	{EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT, "FocalPlaneResolutionUnit",
820 	 N_("Focal Plane Resolution Unit"),
821 	 N_("Indicates the unit for measuring <FocalPlaneXResolution> and "
822 	    "<FocalPlaneYResolution>. This value is the same as the "
823 	    "<ResolutionUnit>."),
824 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
825 	{EXIF_TAG_SUBJECT_LOCATION, "SubjectLocation",
826 	 N_("Subject Location"),
827 	 N_("Indicates the location of the main subject in the scene. The "
828 	    "value of this tag represents the pixel at the center of the "
829 	    "main subject relative to the left edge, prior to rotation "
830 	    "processing as per the <Rotation> tag. The first value "
831 	    "indicates the X column number and the second indicates "
832 	    "the Y row number."),
833 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
834 	{EXIF_TAG_EXPOSURE_INDEX, "ExposureIndex", N_("Exposure Index"),
835 	 N_("Indicates the exposure index selected on the camera or "
836 	    "input device at the time the image is captured."),
837 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
838 	{EXIF_TAG_SENSING_METHOD, "SensingMethod", N_("Sensing Method"),
839 	 N_("Indicates the image sensor type on the camera or input "
840 	    "device."),
841 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
842 	{EXIF_TAG_FILE_SOURCE, "FileSource", N_("File Source"),
843 	 N_("Indicates the image source. If a DSC recorded the image, "
844 	    "the tag value of this tag always be set to 3, indicating "
845 	    "that the image was recorded on a DSC."),
846 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
847 	{EXIF_TAG_SCENE_TYPE, "SceneType", N_("Scene Type"),
848 	 N_("Indicates the type of scene. If a DSC recorded the image, "
849 	    "this tag value must always be set to 1, indicating that the "
850 	    "image was directly photographed."),
851 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
852 	{EXIF_TAG_NEW_CFA_PATTERN, "CFAPattern",
853 	 N_("CFA Pattern"),
854 	 N_("Indicates the color filter array (CFA) geometric pattern of the "
855 	    "image sensor when a one-chip color area sensor is used. "
856 	    "It does not apply to all sensing methods."),
857 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
858 	{EXIF_TAG_CUSTOM_RENDERED, "CustomRendered", N_("Custom Rendered"),
859 	 N_("This tag indicates the use of special processing on image "
860 	    "data, such as rendering geared to output. When special "
861 	    "processing is performed, the reader is expected to disable "
862 	    "or minimize any further processing."),
863 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
864 	{EXIF_TAG_EXPOSURE_MODE, "ExposureMode", N_("Exposure Mode"),
865 	 N_("This tag indicates the exposure mode set when the image was "
866 	    "shot. In auto-bracketing mode, the camera shoots a series of "
867 	    "frames of the same scene at different exposure settings."),
868 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
869 	{EXIF_TAG_WHITE_BALANCE, "WhiteBalance", N_("White Balance"),
870 	 N_("This tag indicates the white balance mode set when the image "
871 	    "was shot."),
872 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
873 	{EXIF_TAG_DIGITAL_ZOOM_RATIO, "DigitalZoomRatio",
874 	 N_("Digital Zoom Ratio"),
875 	 N_("This tag indicates the digital zoom ratio when the image was "
876 	    "shot. If the numerator of the recorded value is 0, this "
877 	    "indicates that digital zoom was not used."),
878 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
879 	{EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM, "FocalLengthIn35mmFilm",
880 	 N_("Focal Length in 35mm Film"),
881 	 N_("This tag indicates the equivalent focal length assuming a "
882 	    "35mm film camera, in mm. A value of 0 means the focal "
883 	    "length is unknown. Note that this tag differs from the "
884 	    "FocalLength tag."),
885 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
886 	{EXIF_TAG_SCENE_CAPTURE_TYPE, "SceneCaptureType",
887 	 N_("Scene Capture Type"),
888 	 N_("This tag indicates the type of scene that was shot. It can "
889 	    "also be used to record the mode in which the image was "
890 	    "shot. Note that this differs from the scene type "
891 	    "<SceneType> tag."),
892 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
893 	{EXIF_TAG_GAIN_CONTROL, "GainControl", N_("Gain Control"),
894 	 N_("This tag indicates the degree of overall image gain "
895 	    "adjustment."),
896 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
897 	{EXIF_TAG_CONTRAST, "Contrast", N_("Contrast"),
898 	 N_("This tag indicates the direction of contrast processing "
899 	    "applied by the camera when the image was shot."),
900 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
901 	{EXIF_TAG_SATURATION, "Saturation", N_("Saturation"),
902 	 N_("This tag indicates the direction of saturation processing "
903 	    "applied by the camera when the image was shot."),
904 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
905 	{EXIF_TAG_SHARPNESS, "Sharpness", N_("Sharpness"),
906 	 N_("This tag indicates the direction of sharpness processing "
907 	    "applied by the camera when the image was shot."),
908 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
909 	{EXIF_TAG_DEVICE_SETTING_DESCRIPTION, "DeviceSettingDescription",
910 	 N_("Device Setting Description"),
911 	 N_("This tag indicates information on the picture-taking "
912 	    "conditions of a particular camera model. The tag is used "
913 	    "only to indicate the picture-taking conditions in the "
914 	    "reader."),
915 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
916 	{EXIF_TAG_SUBJECT_DISTANCE_RANGE, "SubjectDistanceRange",
917 	 N_("Subject Distance Range"),
918 	 N_("This tag indicates the distance to the subject."),
919 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
920 	{EXIF_TAG_IMAGE_UNIQUE_ID, "ImageUniqueID", N_("Image Unique ID"),
921 	 N_("This tag indicates an identifier assigned uniquely to "
922 	    "each image. It is recorded as an ASCII string equivalent "
923 	    "to hexadecimal notation and 128-bit fixed length."),
924 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
925 	/* EXIF 2.3 */
926 	{EXIF_TAG_CAMERA_OWNER_NAME, "CameraOwnerName", N_("Camera Owner Name"),
927 	 N_("This tag indicates the name of the camera owner, "
928             "photographer or image creator."),
929 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
930 	/* EXIF 2.3 */
931 	{EXIF_TAG_BODY_SERIAL_NUMBER, "BodySerialNumber", N_("Body Serial Number"),
932 	 N_("This tag indicates the serial number of the body of the camera"),
933 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
934 	/* EXIF 2.3 */
935 	{EXIF_TAG_LENS_SPECIFICATION, "LensSpecification", N_("Lens Specification"),
936 	 N_("This tag indicates minimum focal length, "
937             "maximum focal length, minimum F number in the "
938             "minimum focal length, and minimum F number in "
939             "the maximum focal length."),
940 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
941 	/* EXIF 2.3 */
942 	{EXIF_TAG_LENS_MAKE, "LensMake", N_("Lens Make"),
943 	 N_("This tag indicates the lens manufacturer."),
944 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
945 	/* EXIF 2.3 */
946 	{EXIF_TAG_LENS_MODEL, "LensModel", N_("Lens Model"),
947 	 N_("This tag indicates the lens' model name and model number."),
948 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
949 	/* EXIF 2.3 */
950 	{EXIF_TAG_LENS_SERIAL_NUMBER, "LensSerialNumber", N_("Lens Serial Number"),
951 	 N_("This tag indicates the serial number of the interchangeable lens."),
952 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
953 	/* EXIF 2.32 */
954 	{EXIF_TAG_COMPOSITE_IMAGE, "CompositeImage", N_("Composite Image"),
955 	 N_("This tag indicates whether this image was composed from multiple images"),
956 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
957 	/* EXIF 2.32 */
958 	{EXIF_TAG_SOURCE_IMAGE_NUMBER_OF_COMPOSITE_IMAGE, "SourceImageNumberOfCompositeImage", N_("Source Image Number Of Composite Image"),
959 	 N_("This tag indicates how many images are included and used in the composition of this image"),
960 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
961 	/* EXIF 2.32 */
962 	{EXIF_TAG_SOURCE_EXPOSURE_TIMES_OF_COMPOSITE_IMAGE, "SourceExposureTimesOfCompositeImage", N_("Source Exposure Times of Composite Image"),
963 	 N_("This tag indicates the exposure times of the source images of this image"),
964 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
965 	/* EXIF 2.3 */
966 	{EXIF_TAG_GAMMA, "Gamma", N_("Gamma"),
967 	 N_("Indicates the value of coefficient gamma."),
968 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
969 	/* Not in EXIF 2.2 */
970 	{EXIF_TAG_PRINT_IMAGE_MATCHING, "PrintImageMatching", N_("PRINT Image Matching"),
971 	 N_("Related to Epson's PRINT Image Matching technology"),
972 	 ESL_UNKNOWN},
973 	/* Not in EXIF 2.2 (from the Microsoft HD Photo specification) */
974 	{EXIF_TAG_PADDING, "Padding", N_("Padding"),
975 	 N_("This tag reserves space that can be reclaimed later when "
976             "additional metadata are added. New metadata can be written "
977             "in place by replacing this tag with a smaller data element "
978             "and using the reclaimed space to store the new or expanded "
979             "metadata tags."),
980 	 { ESL_OOOO, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
981 	{EXIF_TAG_ISO_SPEED_LATITUDE_YYY, "ISOSpeedLatitudeyyy",
982 	 N_("ISO Speed Latitudeyyy"),
983 	 N_("The tag indicate the ISO speed latitude yyy value of the camera or input device that is defined in ISO 12232."),
984 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
985 	{EXIF_TAG_ISO_SPEED_LATITUDE_ZZZ, "ISOSpeedLatitudezzz",
986 	 N_("ISO Speed Latitudezzz"),
987 	 N_("The tag indicate the ISO speed latitude zzz value of the camera or input device that is defined in ISO 12232."),
988 	 { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } },
989 	{EXIF_TAG_DEFALUT_CROP_SIZE, "DefaultCropSize",
990 	 N_("Default Crop Size"),
991 	 N_("DefaultCropSize specifies the final image size in raw coordinates, accounting for extra edge pixels."),
992 	 { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
993 	{EXIF_TAG_DNG_VERSION, "DNGVersion",
994 	 N_("DNG Version"),
995 	 N_("The DNGVersion tag encodes the four-tier version number for DNG specification compliance."),
996 	 { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
997 	{EXIF_TAG_OLD_SUBFILE_TYPE, "SubfileType",
998 	 N_("Subfile Type"),
999 	 N_("This tag indicates horizontal positioning errors in meters."),
1000 	 { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } },
1001 #endif
1002 	{0, NULL, NULL, NULL, ESL_UNKNOWN}
1003 };
1004 
1005 /* For now, do not use these functions. */
1006 
1007 /*!
1008  * Return the number of entries in the EXIF tag table, including the
1009  * terminating NULL entry.
1010  */
1011 unsigned int
exif_tag_table_count(void)1012 exif_tag_table_count (void)
1013 {
1014 	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
1015 }
1016 
1017 
1018 ExifTag
exif_tag_table_get_tag(unsigned int n)1019 exif_tag_table_get_tag (unsigned int n)
1020 {
1021 	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
1022 }
1023 
1024 const char *
exif_tag_table_get_name(unsigned int n)1025 exif_tag_table_get_name (unsigned int n)
1026 {
1027 	return (n < exif_tag_table_count ()) ? ExifTagTable[n].name : NULL;
1028 }
1029 
1030 /*!
1031  * Compares the tag with that in entry.
1032  * \param[in] tag pointer to integer tag value
1033  * \param[in] entry pointer to a struct TagEntry
1034  * \return 0 if tags are equal, <0 if tag < entry, >0 if tag > entry
1035  */
1036 static int
match_tag(const void * tag,const void * entry)1037 match_tag(const void *tag, const void *entry)
1038 {
1039 	return *(int*)tag - ((struct TagEntry *)entry)->tag;
1040 }
1041 
1042 
1043 /*!
1044  * Finds the first entry in the EXIF tag table with the given tag number
1045  * using a binary search.
1046  * \param[in] tag to find
1047  * \return index into table, or -1 if not found
1048  */
1049 static int
exif_tag_table_first(ExifTag tag)1050 exif_tag_table_first(ExifTag tag)
1051 {
1052 	int i;
1053 	struct TagEntry *entry = bsearch(&tag, ExifTagTable,
1054 		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
1055 	if (!entry)
1056 		return -1;	/* Not found */
1057 
1058 	/* Calculate index of found entry */
1059 	i = entry - ExifTagTable;
1060 
1061 	/* There may be other entries with the same tag number, so search
1062 	 * backwards to find the first
1063 	 */
1064 	while ((i > 0) && (ExifTagTable[i-1].tag == tag)) {
1065 		--i;
1066 	}
1067 	return i;
1068 }
1069 
1070 #define RECORDED \
1071 ((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
1072  (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
1073  (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
1074  (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
1075 
1076 const char *
exif_tag_get_name_in_ifd(ExifTag tag,ExifIfd ifd)1077 exif_tag_get_name_in_ifd (ExifTag tag, ExifIfd ifd)
1078 {
1079 	unsigned int i;
1080 	int first;
1081 
1082 	if (ifd >= EXIF_IFD_COUNT)
1083 		return NULL;
1084 	first = exif_tag_table_first(tag);
1085 	if (first < 0)
1086 		return NULL;
1087 
1088 	for (i = first; ExifTagTable[i].name; i++) {
1089 		if (ExifTagTable[i].tag == tag) {
1090 		   if (RECORDED)
1091 			   break;
1092 		} else
1093 			return NULL; /* Recorded tag not found in the table */
1094 	}
1095 	return ExifTagTable[i].name;
1096 }
1097 
1098 const char *
exif_tag_get_title_in_ifd(ExifTag tag,ExifIfd ifd)1099 exif_tag_get_title_in_ifd (ExifTag tag, ExifIfd ifd)
1100 {
1101 	unsigned int i;
1102 	int first;
1103 
1104 	if (ifd >= EXIF_IFD_COUNT)
1105 		return NULL;
1106 	first = exif_tag_table_first(tag);
1107 	if (first < 0)
1108 		return NULL;
1109 
1110 	for (i = first; ExifTagTable[i].name; i++) {
1111 		if (ExifTagTable[i].tag == tag) {
1112 		   if (RECORDED)
1113 			   break;
1114 		} else
1115 			return NULL; /* Recorded tag not found in the table */
1116 	}
1117 	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
1118 	return _(ExifTagTable[i].title);
1119 }
1120 
1121 const char *
exif_tag_get_description_in_ifd(ExifTag tag,ExifIfd ifd)1122 exif_tag_get_description_in_ifd (ExifTag tag, ExifIfd ifd)
1123 {
1124 	unsigned int i;
1125 	int first;
1126 
1127 	if (ifd >= EXIF_IFD_COUNT)
1128 		return NULL;
1129 	first = exif_tag_table_first(tag);
1130 	if (first < 0)
1131 		return NULL;
1132 
1133 	for (i = first; ExifTagTable[i].name; i++) {
1134 		if (ExifTagTable[i].tag == tag) {
1135 			if (RECORDED)
1136 				break;
1137 		} else
1138 			return NULL; /* Recorded tag not found in the table */
1139 	}
1140 
1141 	/* GNU gettext acts strangely when given an empty string */
1142 	if (!ExifTagTable[i].description || !*ExifTagTable[i].description)
1143 		return "";
1144 
1145 	/* libexif should use the default system locale.
1146 	 * If an application specifically requires UTF-8, then we
1147 	 * must give the application a way to tell libexif that.
1148 	 *
1149 	 * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
1150 	 */
1151 	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
1152 	return _(ExifTagTable[i].description);
1153 }
1154 
1155 
1156 /**********************************************************************
1157  * convenience functions
1158  **********************************************************************/
1159 
1160 /* generic part: iterate through IFD list and return first result */
1161 typedef const char * (*get_stuff_func) (ExifTag tag, ExifIfd ifd);
1162 
1163 static const char *
exif_tag_get_stuff(ExifTag tag,get_stuff_func func)1164 exif_tag_get_stuff (ExifTag tag, get_stuff_func func)
1165 {
1166 	/* Search IFDs in this order, in decreasing order of number of valid tags */
1167 	static const ExifIfd ifds[EXIF_IFD_COUNT] = {
1168 		EXIF_IFD_EXIF,
1169 		EXIF_IFD_0,
1170 		EXIF_IFD_1,
1171 		EXIF_IFD_INTEROPERABILITY,
1172 		EXIF_IFD_GPS
1173 	};
1174 	int i;
1175 	for (i=0; i<EXIF_IFD_COUNT; i++) {
1176 		const char *result = func(tag, ifds[i]);
1177 		if (result != NULL) {
1178 			return result;
1179 		}
1180 	}
1181 	return (const char *) NULL;
1182 }
1183 
1184 /* explicit functions */
1185 const char *
exif_tag_get_name(ExifTag tag)1186 exif_tag_get_name (ExifTag tag)
1187 {
1188 	return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd);
1189 }
1190 
1191 const char *
exif_tag_get_title(ExifTag tag)1192 exif_tag_get_title (ExifTag tag)
1193 {
1194 	return exif_tag_get_stuff(tag, exif_tag_get_title_in_ifd);
1195 }
1196 
1197 const char *
exif_tag_get_description(ExifTag tag)1198 exif_tag_get_description (ExifTag tag)
1199 {
1200 	return exif_tag_get_stuff(tag, exif_tag_get_description_in_ifd);
1201 }
1202 
1203 
1204 
1205 ExifTag
exif_tag_from_name(const char * name)1206 exif_tag_from_name (const char *name)
1207 {
1208 	if (!name) return 0;
1209 
1210 	unsigned int i;
1211 	unsigned int result=0;
1212 	for (i = 0; ExifTagTable[i].name; i++)
1213 		if (!strcmp (ExifTagTable[i].name, name))  {
1214 		  	result = ExifTagTable[i].tag;
1215 		  	break;
1216 		}
1217 	return result;
1218 }
1219 
1220 ExifIfd
exif_ifd_from_name(const char * name)1221 exif_ifd_from_name(const char* name)
1222 {
1223 	unsigned int i;
1224 	ExifIfd result = EXIF_IFD_0;
1225 
1226 	if (!name) return 0;
1227 
1228 	for (i = 0; ExifTagTable[i].name; i++)
1229 		if (!strcmp(ExifTagTable[i].name, name)) {
1230 			const ExifSupportLevel *esl = &(ExifTagTable[i].esl)[0][0];
1231 			bool found = false;
1232 			for (int irow = 0; irow < 5; irow++) {
1233 				for (int jcol = 0; jcol < 4; jcol++) {
1234 					if (*(esl + irow * 4 + jcol) == EXIF_SUPPORT_LEVEL_MANDATORY || *(esl + irow * 4 + jcol) == EXIF_SUPPORT_LEVEL_OPTIONAL) {
1235 						result = (ExifIfd)irow;
1236 						found = true;
1237 						break;
1238 					}
1239 				}
1240 				if (found) {
1241 					break;
1242 				}
1243 			}
1244 		}
1245 	return result;
1246 }
1247 
1248 /*! Return the support level of a tag in the given IFD with the given data
1249  * type. If the tag is not specified in the EXIF standard, this function
1250  * returns EXIF_SUPPORT_LEVEL_NOT_RECORDED.
1251  *
1252  * \param[in] tag EXIF tag
1253  * \param[in] ifd a valid IFD (not EXIF_IFD_COUNT)
1254  * \param[in] t a valid data type (not EXIF_DATA_TYPE_UNKNOWN)
1255  * \return the level of support for this tag
1256  */
1257 static inline ExifSupportLevel
get_support_level_in_ifd(ExifTag tag,ExifIfd ifd,ExifDataType t)1258 get_support_level_in_ifd (ExifTag tag, ExifIfd ifd, ExifDataType t)
1259 {
1260 	unsigned int i;
1261 	int first = exif_tag_table_first(tag);
1262 	if (first < 0)
1263 		return EXIF_SUPPORT_LEVEL_NOT_RECORDED;
1264 
1265 	for (i = first; ExifTagTable[i].name; i++) {
1266 		if (ExifTagTable[i].tag == tag) {
1267 			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][t];
1268 			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED)
1269 				return supp;
1270 			/* Try looking for another entry */
1271 		} else {
1272 			break; /* We've reached the end of the matching tags */
1273 		}
1274 	}
1275 	return EXIF_SUPPORT_LEVEL_NOT_RECORDED;
1276 }
1277 
1278 /*! Return the support level of a tag in the given IFD, regardless of the
1279  * data type. If the support level varies depending on the data type, this
1280  * function returns EXIF_SUPPORT_LEVEL_UNKNOWN. If the tag is not specified
1281  * in the EXIF standard, this function returns EXIF_SUPPORT_LEVEL_UNKNOWN.
1282  *
1283  * \param[in] tag EXIF tag
1284  * \param[in] ifd a valid IFD (not EXIF_IFD_COUNT)
1285  * \return the level of support for this tag
1286  */
1287 static inline ExifSupportLevel
get_support_level_any_type(ExifTag tag,ExifIfd ifd)1288 get_support_level_any_type (ExifTag tag, ExifIfd ifd)
1289 {
1290 	unsigned int i;
1291 	int first = exif_tag_table_first(tag);
1292 	if (first < 0)
1293 		return EXIF_SUPPORT_LEVEL_UNKNOWN;
1294 
1295 	for (i = first; ExifTagTable[i].name; i++) {
1296 		if (ExifTagTable[i].tag == tag) {
1297 			/*
1298 			 * Check whether the support level is the same for all possible
1299 			 * data types and isn't marked not recorded.
1300 			 */
1301 			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
1302 			/* If level is not recorded, keep searching for another */
1303 			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
1304 				unsigned int dt;
1305 				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
1306 					if (ExifTagTable[i].esl[ifd][dt] != supp)
1307 						break;
1308 				}
1309 				if (dt == EXIF_DATA_TYPE_COUNT)
1310 					/* Support level is always the same, so return it */
1311 					return supp;
1312 			}
1313 			/* Keep searching the table for another tag for our IFD */
1314 		} else {
1315 			break; /* We've reached the end of the matching tags */
1316 		}
1317 	}
1318 	return EXIF_SUPPORT_LEVEL_UNKNOWN;
1319 }
1320 
1321 ExifSupportLevel
exif_tag_get_support_level_in_ifd(ExifTag tag,ExifIfd ifd,ExifDataType t)1322 exif_tag_get_support_level_in_ifd (ExifTag tag, ExifIfd ifd, ExifDataType t)
1323 {
1324 	if (ifd >= EXIF_IFD_COUNT)
1325 		return EXIF_SUPPORT_LEVEL_UNKNOWN;
1326 
1327 	if (t >= EXIF_DATA_TYPE_COUNT)
1328 		return get_support_level_any_type (tag, ifd);
1329 
1330 	return get_support_level_in_ifd (tag, ifd, t);
1331 }
1332