2004-11-10 Lutz Mueller <lutz@users.sourceforge.net>
[platform/upstream/libexif.git] / libexif / exif-tag.c
1 /* exif-tag.c
2  *
3  * Copyright © 2001 Lutz Müller <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., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #include "config.h"
22 #include "exif-tag.h"
23 #include "i18n.h"
24
25 #include <stdlib.h>
26
27 typedef enum {
28         ESL_MANDATORY    = 1, /* Mandatory               */
29         ESL_CMANDATORY   = 2, /* Conditionally mandatory */
30         ESL_OPTIONAL     = 3, /* Optional                */
31         ESL_NOT_RECORDED = 4  /* Not recorded            */
32 } ExifSL;                     /* Exif Support Level      */
33
34 static struct {
35         ExifTag tag;
36         const char *name;
37         const char *title;
38         const char *description;
39         ExifSL esl_0[4], esl_1[4], esl_exif[4], esl_gps[4];
40 } ExifTagTable[] = {
41         {EXIF_TAG_NEW_SUBFILE_TYPE, "NewSubfileType",
42          "New Subfile Type", N_("A general indication of the kind of data "
43             "contained in this subfile.")},
44         {EXIF_TAG_INTEROPERABILITY_INDEX, "InteroperabilityIndex",
45          "InteroperabilityIndex",
46          N_("Indicates the identification of the Interoperability rule. "
47             "Use \"R98\" for stating ExifR98 Rules. Four bytes used "
48             "including the termination code (NULL). see the separate "
49             "volume of Recommended Exif Interoperability Rules (ExifR98) "
50             "for other tags used for ExifR98.")},
51         {EXIF_TAG_INTEROPERABILITY_VERSION, "InteroperabilityVersion",
52          "InteroperabilityVersion", ""},
53         {EXIF_TAG_IMAGE_WIDTH, "ImageWidth", N_("Image Width"),
54          N_("The number of columns of image data, equal to the number of "
55             "pixels per row. In JPEG compressed data a JPEG marker is "
56             "used instead of this tag."),
57          {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}},
58         {EXIF_TAG_IMAGE_LENGTH, "ImageLength", N_("Image Length"),
59          N_("The number of rows of image data. In JPEG compressed data a "
60             "JPEG marker is used instead of this tag."), 
61          {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}},
62         {EXIF_TAG_BITS_PER_SAMPLE, "BitsPerSample", N_("Bits per Sample"),
63          N_("The number of bits per image component. In this standard each "
64             "component of the image is 8 bits, so the value for this "
65             "tag is 9. See also <SamplesPerPixel>. In JPEG compressed data "
66             "a JPEG marker is used instead of this tag."),
67          {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}},
68         {EXIF_TAG_COMPRESSION, "Compression", N_("Compression"),
69          N_("The compression scheme used for the image data. When a "
70             "primary image is JPEG compressed, this designation is "
71             "not necessary and is omitted. When thumbnails use JPEG "
72             "compression, this tag value is set to 6."),
73          {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}},
74         {EXIF_TAG_PHOTOMETRIC_INTERPRETATION, "PhotometricInterpretation",
75          N_("Photometric Interpretation"),
76          N_("The pixel composition. In JPEG compressed data a JPEG "
77             "marker is used instead of this tag."),
78          {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}},
79         {EXIF_TAG_FILL_ORDER, "FillOrder", N_("Fill Order"), ""},
80         {EXIF_TAG_DOCUMENT_NAME, "DocumentName", N_("Document Name"), ""},
81         {EXIF_TAG_IMAGE_DESCRIPTION, "ImageDescription",
82          N_("Image Description"),
83          N_("A character string giving the title of the image. It may be "
84             "a comment such as \"1988 company picnic\" or "
85             "the like. Two-bytes character codes cannot be used. "
86             "When a 2-bytes code is necessary, the Exif Private tag "
87             "<UserComment> is to be used."),
88          {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}},
89         {EXIF_TAG_MAKE, "Make", N_("Manufacturer"),
90          N_("The manufacturer of the recording "
91             "equipment. This is the manufacturer of the DSC, scanner, "
92             "video digitizer or other equipment that generated the "
93             "image. When the field is left blank, it is treated as "
94             "unknown."),
95          {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}},
96         {EXIF_TAG_MODEL, "Model", N_("Model"),
97          N_("The model name or model number of the equipment. This is the "
98             "model name or number of the DSC, scanner, video digitizer "
99             "or other equipment that generated the image. When the field "
100             "is left blank, it is treated as unknown."),
101          {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}},
102         {EXIF_TAG_STRIP_OFFSETS, "StripOffsets", N_("Strip Offsets"),
103          N_("For each strip, the byte offset of that strip. It is "
104             "recommended that this be selected so the number of strip "
105             "bytes does not exceed 64 Kbytes. With JPEG compressed "
106             "data this designation is not needed and is omitted. See also "
107             "<RowsPerStrip> and <StripByteCounts>."),
108          {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}},
109         {EXIF_TAG_ORIENTATION, "Orientation", N_("Orientation"),
110          N_("The image orientation viewed in terms of rows and columns."),
111          {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}},
112         {EXIF_TAG_SAMPLES_PER_PIXEL, "SamplesPerPixel",
113          N_("Samples per Pixel"),
114          N_("The number of components per pixel. Since this standard applies "
115             "to RGB and YCbCr images, the value set for this tag is 3. "
116             "In JPEG compressed data a JPEG marker is used instead of this "
117             "tag.")},
118         {EXIF_TAG_ROWS_PER_STRIP, "RowsPerStrip", N_("Rows per Strip"),
119          N_("The number of rows per strip. This is the number of rows "
120             "in the image of one strip when an image is divided into "
121             "strips. With JPEG compressed data this designation is not "
122             "needed and is omitted. See also <RowsPerStrip> and "
123             "<StripByteCounts>.")},
124         {EXIF_TAG_STRIP_BYTE_COUNTS, "StripByteCounts", N_("Strip Byte Count"),
125          N_("The total number of bytes in each strip. With JPEG compressed "
126             "data this designation is not needed and is omitted.")},
127         {EXIF_TAG_X_RESOLUTION, "XResolution", N_("x-Resolution"),
128          N_("The number of pixels per <ResolutionUnit> in the <ImageWidth> "
129             "direction. When the image resolution is unknown, 72 [dpi] "
130             "is designated.")},
131         {EXIF_TAG_Y_RESOLUTION, "YResolution", N_("y-Resolution"),
132          N_("The number of pixels per <ResolutionUnit> in the <ImageLength> "
133             "direction. The same value as <XResolution> is designated.")},
134         {EXIF_TAG_PLANAR_CONFIGURATION, "PlanarConfiguration",
135          N_("Planar Configuration"),
136          N_("Indicates whether pixel components are recorded in a chunky "
137             "or planar format. In JPEG compressed files a JPEG marker "
138             "is used instead of this tag. If this field does not exist, "
139             "the TIFF default of 1 (chunky) is assumed.")},
140         {EXIF_TAG_RESOLUTION_UNIT, "ResolutionUnit", N_("Resolution Unit"),
141          N_("The unit for measuring <XResolution> and <YResolution>. The same "
142             "unit is used for both <XResolution> and <YResolution>. If "
143             "the image resolution is unknown, 2 (inches) is designated.")},
144         {EXIF_TAG_TRANSFER_FUNCTION, "TransferFunction",
145          N_("Transfer Function"),
146          N_("A transfer function for the image, described in tabular style. "
147             "Normally this tag is not necessary, since color space is "
148             "specified in the color space information tag (<ColorSpace>).")},
149         {EXIF_TAG_SOFTWARE, "Software", N_("Software"),
150          N_("This tag records the name and version of the software or "
151             "firmware of the camera or image input device used to "
152             "generate the image. The detailed format is not specified, but "
153             "it is recommended that the example shown below be "
154             "followed. When the field is left blank, it is treated as "
155             "unknown.")},
156         {EXIF_TAG_DATE_TIME, "DateTime", N_("Date and Time"),
157          N_("The date and time of image creation. In this standard "
158             "(EXIF-2.1) it is the date and time the file was changed.")},
159         {EXIF_TAG_ARTIST, "Artist", N_("Artist"),
160          N_("This tag records the name of the camera owner, photographer or "
161             "image creator. The detailed format is not specified, but it is "
162             "recommended that the information be written as in the example "
163             "below for ease of Interoperability. When the field is "
164             "left blank, it is treated as unknown.")},
165         {EXIF_TAG_WHITE_POINT, "WhitePoint", N_("White Point"),
166          N_("The chromaticity of the white point of the image. Normally "
167             "this tag is not necessary, since color space is specified "
168             "in the colorspace information tag (<ColorSpace>).")},
169         {EXIF_TAG_PRIMARY_CHROMATICITIES, "PrimaryChromaticities",
170          N_("Primary Chromaticities"),
171          N_("The chromaticity of the three primary colors of the image. "
172             "Normally this tag is not necessary, since colorspace is "
173             "specified in the colorspace information tag (<ColorSpace>).")},
174         {EXIF_TAG_TRANSFER_RANGE, "TransferRange", N_("Transfer Range"), ""},
175         {EXIF_TAG_SUB_IFDS, "SubIFDs", "SubIFD Offsets", N_("Defined by Adobe Corporation "
176             "to enable TIFF Trees within a TIFF file.")},
177         {EXIF_TAG_JPEG_PROC, "JPEGProc", "JPEGProc", ""},
178         {EXIF_TAG_JPEG_INTERCHANGE_FORMAT, "JPEGInterchangeFormat",
179          N_("JPEG Interchange Format"),
180          N_("The offset to the start byte (SOI) of JPEG compressed "
181             "thumbnail data. This is not used for primary image "
182             "JPEG data.")},
183         {EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH,
184          "JPEGInterchangeFormatLength", N_("JPEG Interchange Format Length"),
185          N_("The number of bytes of JPEG compressed thumbnail data. This "
186             "is not used for primary image JPEG data. JPEG thumbnails "
187             "are not divided but are recorded as a continuous JPEG "
188             "bitstream from SOI to EOI. Appn and COM markers should "
189             "not be recorded. Compressed thumbnails must be recorded in no "
190             "more than 64 Kbytes, including all other data to be "
191             "recorded in APP1.")},
192         {EXIF_TAG_YCBCR_COEFFICIENTS, "YCbCrCoefficients",
193          N_("YCbCr Coefficients"),
194          N_("The matrix coefficients for transformation from RGB to YCbCr "
195             "image data. No default is given in TIFF; but here the "
196             "value given in Appendix E, \"Color Space Guidelines\", is used "
197             "as the default. The color space is declared in a "
198             "color space information tag, with the default being the value "
199             "that gives the optimal image characteristics "
200             "Interoperability this condition.")},
201         {EXIF_TAG_YCBCR_SUB_SAMPLING, "YCbCrSubSampling",
202          N_("YCbCr Sub-Sampling"),
203          N_("The sampling ratio of chrominance components in relation to the "
204             "luminance component. In JPEG compressed data a JPEG marker "
205             "is used instead of this tag.")},
206         {EXIF_TAG_YCBCR_POSITIONING, "YCbCrPositioning",
207          N_("YCbCr Positioning"),
208          N_("The position of chrominance components in relation to the "
209             "luminance component. This field is designated only for "
210             "JPEG compressed data or uncompressed YCbCr data. The TIFF "
211             "default is 1 (centered); but when Y:Cb:Cr = 4:2:2 it is "
212             "recommended in this standard that 2 (co-sited) be used to "
213             "record data, in order to improve the image quality when viewed "
214             "on TV systems. When this field does not exist, the reader shall "
215             "assume the TIFF default. In the case of Y:Cb:Cr = 4:2:0, the "
216             "TIFF default (centered) is recommended. If the reader "
217             "does not have the capability of supporting both kinds of "
218             "<YCbCrPositioning>, it shall follow the TIFF default regardless "
219             "of the value in this field. It is preferable that readers "
220             "be able to support both centered and co-sited positioning.")},
221         {EXIF_TAG_REFERENCE_BLACK_WHITE, "ReferenceBlackWhite",
222          N_("Reference Black/White"),
223          N_("The reference black point value and reference white point "
224             "value. No defaults are given in TIFF, but the values "
225             "below are given as defaults here. The color space is declared "
226             "in a color space information tag, with the default "
227             "being the value that gives the optimal image characteristics "
228             "Interoperability these conditions.")},
229         {EXIF_TAG_XML_PACKET, "XMLPacket", N_("XML Packet"), N_("XMP Metadata")},
230         {EXIF_TAG_RELATED_IMAGE_FILE_FORMAT, "RelatedImageFileFormat",
231          "RelatedImageFileFormat", ""},
232         {EXIF_TAG_RELATED_IMAGE_WIDTH, "RelatedImageWidth",
233          "RelatedImageWidth", ""},
234         {EXIF_TAG_RELATED_IMAGE_LENGTH, "RelatedImageLength",
235          "RelatedImageLength", ""},
236         {EXIF_TAG_CFA_REPEAT_PATTERN_DIM, "CFARepeatPatternDim",
237          "CFARepeatPatternDim", ""},
238         {EXIF_TAG_CFA_PATTERN, "CFAPattern",
239          N_("CFA Pattern"),
240          N_("Indicates the color filter array (CFA) geometric pattern of the "
241             "image sensor when a one-chip color area sensor is used. "
242             "It does not apply to all sensing methods.")},
243         {EXIF_TAG_BATTERY_LEVEL, "BatteryLevel", N_("Battery Level"), ""},
244         {EXIF_TAG_COPYRIGHT, "Copyright", N_("Copyright"),
245          N_("Copyright information. In this standard the tag is used to "
246             "indicate both the photographer and editor copyrights. It is "
247             "the copyright notice of the person or organization claiming "
248             "rights to the image. The Interoperability copyright "
249             "statement including date and rights should be written in this "
250             "field; e.g., \"Copyright, John Smith, 19xx. All rights "
251             "reserved.\". In this standard the field records both the "
252             "photographer and editor copyrights, with each recorded in a "
253             "separate part of the statement. When there is a clear "
254             "distinction between the photographer and editor copyrights, "
255             "these are to be written in the order of photographer followed "
256             "by editor copyright, separated by NULL (in this case, "
257             "since the statement also ends with a NULL, there are two NULL "
258             "codes) (see example 1). When only the photographer is given, "
259             "it is terminated by one NULL code (see example 2). When only "
260             "the editor copyright is given, "
261             "the photographer copyright part consists of one space followed "
262             "by a terminating NULL code, then the editor copyright is given "
263             "(see example 3). When the field is left blank, it is treated "
264             "as unknown.")},
265         {EXIF_TAG_EXPOSURE_TIME, "ExposureTime", N_("Exposure Time"),
266          N_("Exposure time, given in seconds (sec).")},
267         {EXIF_TAG_FNUMBER, "FNumber", "FNumber",
268          N_("The F number.")},
269         {EXIF_TAG_IPTC_NAA, "IPTC/NAA", "IPTC/NAA", ""},
270         {EXIF_TAG_IMAGE_RESOURCES, "ImageResources", N_("Image Resources Block"), ""},
271         {EXIF_TAG_EXIF_IFD_POINTER, "ExifIFDPointer", "ExifIFDPointer",
272          N_("A pointer to the Exif IFD. Interoperability, Exif IFD has the "
273             "same structure as that of the IFD specified in TIFF. "
274             "ordinarily, however, it does not contain image data as in "
275             "the case of TIFF.")},
276         {EXIF_TAG_INTER_COLOR_PROFILE, "InterColorProfile",
277          "InterColorProfile", ""},
278         {EXIF_TAG_EXPOSURE_PROGRAM, "ExposureProgram", "ExposureProgram",
279          N_("The class of the program used by the camera to set exposure "
280             "when the picture is taken.")},
281         {EXIF_TAG_SPECTRAL_SENSITIVITY, "SpectralSensitivity",
282          N_("Spectral Sensitivity"),
283          N_("Indicates the spectral sensitivity of each channel of the "
284             "camera used. The tag value is an ASCII string compatible "
285             "with the standard developed by the ASTM Technical committee.")},
286         {EXIF_TAG_GPS_INFO_IFD_POINTER, "GPSInfoIFDPointer", 
287          "GPSInfoIFDPointer",
288          N_("A pointer to the GPS Info IFD. The "
289             "Interoperability structure of the GPS Info IFD, like that of "
290             "Exif IFD, has no image data.")},
291 #if 0
292         {EXIF_TAG_GPS_VERSION_ID, "GPSVersionID", "",
293          N_("Indicates the version of <GPSInfoIFD>. The version is given "
294             "as 2.0.0.0. This tag is mandatory when <GPSInfo> tag is "
295             "present. (Note: The <GPSVersionID tag is given in bytes, "
296             "unlike the <ExifVersion> tag. When the version is "
297             "2.0.0.0, the tag value is 02000000.H).")},
298         {EXIF_TAG_GPS_LATITUDE_REF, "GPSLatitudeRef", ""
299          N_("Indicates whether the latitude is north or south latitude. The "
300             "ASCII value 'N' indicates north latitude, and 'S' is south "
301             "latitude.")},
302         {EXIF_TAG_GPS_LATITUDE, "GPSLatitude", ""
303          N_("Indicates the latitude. The latitude is expressed as three "
304             "RATIONAL values giving the degrees, minutes, and seconds, "
305             "respectively. When degrees, minutes and seconds are expressed, "
306             "the format is dd/1,mm/1,ss/1. When degrees and minutes are used "
307             "and, for example, fractions of minutes are given up to two "
308             "two decimal places, the format is dd/1,mmmm/100,0/1.")},
309         {EXIF_TAG_GPS_LONGITUDE_REF, "GPSLongitudeRef", ""
310          N_("Indicates whether the longitude is east or west longitude. "
311             "ASCII 'E' indicates east longitude, and 'W' is west "
312             "longitude.")},
313         {EXIF_TAG_GPS_LONGITUDE, "GPSLongitude", ""
314          N_("Indicates the longitude. The longitude is expressed as three "
315             "RATIONAL values giving the degrees, minutes, and seconds, "
316             "respectively. When degrees, minutes and seconds are expressed, "
317             "the format is ddd/1,mm/1,ss/1. When degrees and minutes are "
318             "used and, for example, fractions of minutes are given up to "
319             "two decimal places, the format is ddd/1,mmmm/100,0/1.")}, 
320 #endif
321         {EXIF_TAG_ISO_SPEED_RATINGS, "ISOSpeedRatings",
322          N_("ISO Speed Ratings"),
323          N_("Indicates the ISO Speed and ISO Latitude of the camera or "
324             "input device as specified in ISO 12232.")},
325         {EXIF_TAG_OECF, "OECF", "OECF",
326          N_("Indicates the Opto-Electoric Conversion Function (OECF) "
327             "specified in ISO 14524. <OECF> is the relationship between "
328             "the camera optical input and the image values.")},
329         {EXIF_TAG_EXIF_VERSION, "ExifVersion", N_("Exif Version"),
330          N_("The version of this standard supported. Nonexistence of this "
331             "field is taken to mean nonconformance to the standard.")},
332         {EXIF_TAG_DATE_TIME_ORIGINAL, "DateTimeOriginal",
333          N_("Date and Time (original)"),
334          N_("The date and time when the original image data was generated. "
335             "For a digital still camera "
336             "the date and time the picture was taken are recorded.")},
337         {EXIF_TAG_DATE_TIME_DIGITIZED, "DateTimeDigitized",
338          N_("Date and Time (digitized)"),
339          N_("The date and time when the image was stored as digital data. ")},
340         {EXIF_TAG_COMPONENTS_CONFIGURATION, "ComponentsConfiguration",
341          "ComponentsConfiguration",
342          N_("Information specific to compressed data. The channels of "
343             "each component are arranged in order from the 1st "
344             "component to the 4th. For uncompressed data the data "
345             "arrangement is given in the <PhotometricInterpretation> tag. "
346             "However, since <PhotometricInterpretation> can only "
347             "express the order of Y, Cb and Cr, this tag is provided "
348             "for cases when compressed data uses components other than "
349             "Y, Cb, and Cr and to enable support of other sequences.")},
350         {EXIF_TAG_COMPRESSED_BITS_PER_PIXEL, "CompressedBitsPerPixel",
351          N_("Compressed Bits per Pixel"),
352          N_("Information specific to compressed data. The compression mode "
353             "used for a compressed image is indicated in unit bits "
354             "per pixel.")},
355         {EXIF_TAG_SHUTTER_SPEED_VALUE, "ShutterSpeedValue", N_("Shutter speed"),
356          N_("Shutter speed. The unit is the APEX (Additive System of "
357             "Photographic Exposure) setting (see Appendix C).")},
358         {EXIF_TAG_APERTURE_VALUE, "ApertureValue", N_("Aperture"),
359          N_("The lens aperture. The unit is the APEX value.")},
360         {EXIF_TAG_BRIGHTNESS_VALUE, "BrightnessValue", N_("Brightness"),
361          N_("The value of brightness. The unit is the APEX value. "
362             "Ordinarily it is given in the range of -99.99 to 99.99.")},
363         {EXIF_TAG_EXPOSURE_BIAS_VALUE, "ExposureBiasValue",
364          N_("Exposure Bias"),
365          N_("The exposure bias. The units is the APEX value. Ordinarily "
366             "it is given in the range of -99.99 to 99.99.")},
367         {EXIF_TAG_MAX_APERTURE_VALUE, "MaxApertureValue", "MaxApertureValue",
368          N_("The smallest F number of the lens. The unit is the APEX value. "
369             "Ordinarily it is given in the range of 00.00 to 99.99, "
370             "but it is not limited to this range.")},
371         {EXIF_TAG_SUBJECT_DISTANCE, "SubjectDistance",
372          N_("Subject Distance"),
373          N_("The distance to the subject, given in meters.")},
374         {EXIF_TAG_METERING_MODE, "MeteringMode", N_("Metering Mode"),
375          N_("The metering mode.")},
376         {EXIF_TAG_LIGHT_SOURCE, "LightSource", N_("Light Source"),
377          N_("The kind of light source.")},
378         {EXIF_TAG_FLASH, "Flash", N_("Flash"),
379          N_("This tag is recorded when an image is taken using a strobe "
380             "light (flash).")},
381         {EXIF_TAG_FOCAL_LENGTH, "FocalLength", N_("Focal Length"),
382          N_("The actual focal length of the lens, in mm. Conversion is not "
383             "made to the focal length of a 35 mm film camera.")},
384         {EXIF_TAG_MAKER_NOTE, "MakerNote", N_("Maker Note"),
385          N_("A tag for manufacturers of Exif writers to record any desired "
386             "information. The contents are up to the manufacturer.")},
387         {EXIF_TAG_USER_COMMENT, "UserComment", N_("User Comment"),
388          N_("A tag for Exif users to write keywords or comments on the image "
389             "besides those in <ImageDescription>, and without the "
390             "character code limitations of the <ImageDescription> tag. The "
391             "character code used in the <UserComment> tag is identified "
392             "based on an ID code in a fixed 8-byte area at the start of "
393             "the tag data area. The unused portion of the area is padded "
394             "with NULL (\"00.h\"). ID codes are assigned by means of "
395             "registration. The designation method and references for each "
396             "character code are given in Table 6. The value of CountN "
397             "is determinated based on the 8 bytes in the character code "
398             "area and the number of bytes in the user comment part. Since "
399             "the TYPE is not ASCII, NULL termination is not necessary "
400             "(see Fig. 9). "
401             "The ID code for the <UserComment> area may be a Defined code "
402             "such as JIS or ASCII, or may be Undefined. The Undefined name "
403             "is UndefinedText, and the ID code is filled with 8 bytes of all "
404             "\"NULL\" (\"00.H\"). An Exif reader that reads the "
405             "<UserComment> tag must have a function for determining the "
406             "ID code. This function is not required in Exif readers that "
407             "do not use the <UserComment> tag (see Table 7). "
408             "When a <UserComment> area is set aside, it is recommended that "
409             "the ID code be ASCII and that the following user comment "
410             "part be filled with blank characters [20.H].")},
411         {EXIF_TAG_SUB_SEC_TIME, "SubsecTime", "SubsecTime",
412          N_("A tag used to record fractions of seconds for the "
413             "<DateTime> tag.")},
414         {EXIF_TAG_SUB_SEC_TIME_ORIGINAL, "SubSecTimeOriginal",
415          "SubSecTimeOriginal",
416          N_("A tag used to record fractions of seconds for the "
417             "<DateTimeOriginal> tag.")},
418         {EXIF_TAG_SUB_SEC_TIME_DIGITIZED, "SubSecTimeDigitized",
419          "SubSecTimeDigitized",
420          N_("A tag used to record fractions of seconds for the "
421             "<DateTimeDigitized> tag.")},
422         {EXIF_TAG_FLASH_PIX_VERSION, "FlashPixVersion", "FlashPixVersion",
423          N_("The FlashPix format version supported by a FPXR file.")},
424         {EXIF_TAG_COLOR_SPACE, "ColorSpace", N_("Color Space"),
425          N_("The color space information tag is always "
426             "recorded as the color space specifier. Normally sRGB (=1) "
427             "is used to define the color space based on the PC monitor "
428             "conditions and environment. If a color space other than "
429             "sRGB is used, Uncalibrated (=FFFF.H) is set. Image data "
430             "recorded as Uncalibrated can be treated as sRGB when it is "
431             "converted to FlashPix. On sRGB see Appendix E.")},
432         {EXIF_TAG_PIXEL_X_DIMENSION, "PixelXDimension", "PixelXDimension",
433          N_("Information specific to compressed data. When a "
434             "compressed file is recorded, the valid width of the "
435             "meaningful image must be recorded in this tag, whether or "
436             "not there is padding data or a restart marker. This tag "
437             "should not exist in an uncompressed file. For details see "
438             "section 2.8.1 and Appendix F.")},
439         {EXIF_TAG_PIXEL_Y_DIMENSION, "PixelYDimension", "PixelYDimension",
440          N_("Information specific to compressed data. When a compressed "
441             "file is recorded, the valid height of the meaningful image "
442             "must be recorded in this tag, whether or not there is padding "
443             "data or a restart marker. This tag should not exist in an "
444             "uncompressed file. For details see section 2.8.1 and Appendix "
445             "F. Since data padding is unnecessary in the vertical direction, "
446             "the number of lines recorded in this valid image height tag "
447             "will in fact be the same as that recorded in the SOF.")},
448         {EXIF_TAG_RELATED_SOUND_FILE, "RelatedSoundFile",
449          "RelatedSoundFile",
450          N_("This tag is used to record the name of an audio file related "
451             "to the image data. The only relational information "
452             "recorded here is the Exif audio file name and extension (an "
453             "ASCII string consisting of 8 characters + '.' + 3 "
454             "characters). The path is not recorded. Stipulations on audio "
455             "are given in  section 3.6.3. File naming conventions are "
456             "given in section 3.7.1. "
457             "When using this tag, audio files must be recorded in "
458             "conformance to the Exif audio format. Writers are also allowed "
459             "to store the data such as Audio within APP2 as FlashPix "
460             "extension stream data. "
461             "Audio files must be recorded in conformance to the Exif audio "
462             "format. The mapping of Exif image files and audio files is done "
463             "in any of the three ways shown in Table 8. If multiple files "
464             "are mapped to one file as in [2] or [3] of this table, the above "
465             "format is used to record just one audio file name. If "
466             "there are multiple audio files, the first recorded file is "
467             "given. In the case of [3] in Table 8, for example, for the "
468             "Exif image file \"DSC00001.JPG\" only  \"SND00001.WAV\" is "
469             "given as the related Exif audio file. When there are three "
470             "Exif audio files \"SND00001.WAV\", \"SND00002.WAV\" and "
471             "\"SND00003.WAV\", the Exif image file name for each of them, "
472             "\"DSC00001.JPG\", is indicated. By combining multiple "
473             "relational information, a variety of playback possibilities "
474             "can be supported. The method of using relational information "
475             "is left to the implementation on the playback side. Since this "
476             "information is an ASCII character string, it is terminated by "
477             "NULL. When this tag is used to map audio files, the relation "
478             "of the audio file to image data must also be indicated on the "
479             "audio file end.")},
480         {EXIF_TAG_INTEROPERABILITY_IFD_POINTER, "InteroperabilityIFDPointer",
481          "InteroperabilityIFDPointer",
482          N_("Interoperability IFD is composed of tags which stores the "
483             "information to ensure the Interoperability and pointed "
484             "by the following tag located in Exif IFD. "
485             "The Interoperability structure of Interoperability IFD is "
486             "the same as TIFF defined IFD structure "
487             "but does not contain the "
488             "image data characteristically compared with normal TIFF "
489             "IFD.")},
490         {EXIF_TAG_FLASH_ENERGY, "FlashEnergy", N_("Flash Energy"),
491          N_("Indicates the strobe energy at the time the image is "
492             "captured, as measured in Beam Candle Power Seconds (BCPS).")},
493         {EXIF_TAG_SPATIAL_FREQUENCY_RESPONSE, "SpatialFrequencyResponse",
494          N_("Spatial Frequency Response"),
495          N_("This tag records the camera or input device spatial frequency "
496             "table and SFR values in the direction of image width, "
497             "image height, and diagonal direction, as specified in ISO "
498             "12233.")},
499         {EXIF_TAG_FOCAL_PLANE_X_RESOLUTION, "FocalPlaneXResolution",
500          N_("Focal Plane x-Resolution"),
501          N_("Indicates the number of pixels in the image width (X) direction "
502             "per <FocalPlaneResolutionUnit> on the camera focal plane.")},
503         {EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION, "FocalPlaneYResolution",
504          N_("Focal Plane y-Resolution"),
505          N_("Indicates the number of pixels in the image height (V) direction "
506             "per <FocalPlaneResolutionUnit> on the camera focal plane.")},
507         {EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT, "FocalPlaneResolutionUnit",
508          N_("Focal Plane Resolution Unit"),
509          N_("Indicates the unit for measuring <FocalPlaneXResolution> and "
510             "<FocalPlaneYResolution>. This value is the same as the "
511             "<ResolutionUnit>.")},
512         {EXIF_TAG_SUBJECT_LOCATION, "SubjectLocation",
513          N_("Subject Location"),
514          N_("Indicates the location of the main subject in the scene. The "
515             "value of this tag represents the pixel at the center of the "
516             "main subject relative to the left edge, prior to rotation "
517             "processing as per the <Rotation> tag. The first value "
518             "indicates the X column number and second indicates "
519             "the Y row number.")},
520         {EXIF_TAG_EXPOSURE_INDEX, "ExposureIndex", N_("Exposure index"),
521          N_("Indicates the exposure index selected on the camera or "
522             "input device at the time the image is captured.")},
523         {EXIF_TAG_SENSING_METHOD, "SensingMethod", N_("Sensing Method"),
524          N_("Indicates the image sensor type on the camera or input "
525             "device.")},
526         {EXIF_TAG_FILE_SOURCE, "FileSource", N_("File Source"),
527          N_("Indicates the image source. If a DSC recorded the image, "
528             "this tag value of this tag always be set to 3, indicating "
529             "that the image was recorded on a DSC.")},
530         {EXIF_TAG_SCENE_TYPE, "SceneType", N_("Scene Type"),
531          N_("Indicates the type of scene. If a DSC recorded the image, "
532             "this tag value must always be set to 1, indicating that the "
533             "image was directly photographed.")},
534         {EXIF_TAG_NEW_CFA_PATTERN, "CFAPattern",
535          N_("CFA Pattern"),
536          N_("Indicates the color filter array (CFA) geometric pattern of the "
537             "image sensor when a one-chip color area sensor is used. "
538             "It does not apply to all sensing methods.")},
539         {EXIF_TAG_SUBJECT_AREA, "SubjectArea", N_("Subject Area"),
540          N_("This tag indicates the location and area of the main subject "
541             "in the overall scene.")},
542         {EXIF_TAG_TIFF_EP_STANDARD_ID, "TIFF/EPStandardID", N_("TIFF/EP Standard ID"), ""},
543         {EXIF_TAG_CUSTOM_RENDERED, "CustomRendered", N_("Custom Rendered"),
544          N_("This tag indicates the use of special processing on image "
545             "data, such as rendering geared to output. When special "
546             "processing is performed, the reader is expected to disable "
547             "or minimize any further processing.")},
548         {EXIF_TAG_EXPOSURE_MODE, "ExposureMode", N_("Exposure Mode"),
549          N_("This tag indicates the exposure mode set when the image was "
550             "shot. In auto-bracketing mode, the camera shoots a series of "
551             "frames of the same scene at different exposure settings.")},
552         {EXIF_TAG_WHITE_BALANCE, "WhiteBalance", N_("White Balance"),
553          N_("This tag indicates the white balance mode set when the image "
554             "was shot.")},
555         {EXIF_TAG_DIGITAL_ZOOM_RATIO, "DigitalZoomRatio",
556          N_("Digital Zoom Ratio"),
557          N_("This tag indicates the digital zoom ratio when the image was "
558             "shot. If the numerator of the recorded value is 0, this "
559             "indicates that digital zoom was not used.")},
560         {EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM, "FocalLengthIn35mmFilm",
561          N_("Focal Length In 35mm Film"),
562          N_("This tag indicates the equivalent focal length assuming a "
563             "35mm film camera, in mm. A value of 0 means the focal "
564             "length is unknown. Note that this tag differs from the "
565             "FocalLength tag.")},
566         {EXIF_TAG_SCENE_CAPTURE_TYPE, "SceneCaptureType",
567          N_("Scene Capture Type"),
568          N_("This tag indicates the type of scene that was shot. It can "
569             "also be used to record the mode in which the image was "
570             "shot. Note that this differs from the scene type "
571             "(SceneType) tag.")},
572         {EXIF_TAG_GAIN_CONTROL, "GainControl", N_("Gain Control"),
573          N_("This tag indicates the degree of overall image gain "
574             "adjustment.")},
575         {EXIF_TAG_CONTRAST, "Contrast", N_("Contrast"),
576          N_("This tag indicates the direction of contrast processing "
577             "applied by the camera when the image was shot.")},
578         {EXIF_TAG_SATURATION, "Saturation", N_("Saturation"),
579          N_("This tag indicates the direction of saturation processing "
580             "applied by the camera when the image was shot.")},
581         {EXIF_TAG_SHARPNESS, "Sharpness", N_("Sharpness"),
582          N_("This tag indicates the direction of sharpness processing "
583             "applied by the camera when the image was shot.")},
584         {EXIF_TAG_DEVICE_SETTING_DESCRIPTION, "DeviceSettingDescription",
585          N_("Device Setting Description"),
586          N_("This tag indicates information on the picture-taking "
587             "conditions of a particular camera model. The tag is used "
588             "only to indicate the picture-taking conditions in the "
589             "reader.")},
590         {EXIF_TAG_SUBJECT_DISTANCE_RANGE, "SubjectDistanceRange",
591          N_("Subject Distance Range"),
592          N_("This tag indicates the distance to the subject.")},
593         {EXIF_TAG_IMAGE_UNIQUE_ID, "ImageUniqueID", N_("Image Unique ID"),
594          N_("This tag indicates an identifier assigned uniquely to "
595             "each image. It is recorded as an ASCII string equivalent "
596             "to hexadecimal notation and 128-bit fixed length.")},
597         {0, NULL, NULL, NULL}
598 };
599
600 /* For now, do not use these functions. */
601 ExifTag      exif_tag_table_get_tag  (unsigned int n);
602 const char  *exif_tag_table_get_name (unsigned int n);
603 unsigned int exif_tag_table_count    (void);
604
605 ExifTag
606 exif_tag_table_get_tag (unsigned int n)
607 {
608         return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
609 }
610
611 const char *
612 exif_tag_table_get_name (unsigned int n)
613 {
614         return (n < exif_tag_table_count ()) ? ExifTagTable[n].name : NULL;
615 }
616
617 unsigned int
618 exif_tag_table_count (void)
619 {
620         return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
621 }
622
623 const char *
624 exif_tag_get_name (ExifTag tag)
625 {
626         unsigned int i;
627
628         for (i = 0; ExifTagTable[i].name; i++)
629                 if (ExifTagTable[i].tag == tag)
630                         break;
631
632         return ExifTagTable[i].name;
633 }
634
635 const char *
636 exif_tag_get_title (ExifTag tag)
637 {
638         unsigned int i;
639
640         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
641         bindtextdomain (GETTEXT_PACKAGE, LIBEXIF_LOCALEDIR);
642
643         for (i = 0; ExifTagTable[i].title; i++)
644                 if (ExifTagTable[i].tag == tag) break;
645         return _(ExifTagTable[i].title);
646 }
647
648 const char *
649 exif_tag_get_description (ExifTag tag)
650 {
651         unsigned int i;
652
653         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
654         bindtextdomain (GETTEXT_PACKAGE, LIBEXIF_LOCALEDIR);
655
656         for (i = 0; ExifTagTable[i].description; i++)
657                 if (ExifTagTable[i].tag == tag) break;
658         return _(ExifTagTable[i].description);
659 }
660
661 ExifTag 
662 exif_tag_from_name (const char *name)
663 {
664         unsigned int i;
665
666         if (!name) return 0;
667
668         for (i = 0; ExifTagTable[i].name; i++)
669                 if (!strcmp (ExifTagTable[i].name, name)) break;
670         return ExifTagTable[i].tag;
671 }