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