• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*! \file exif-tag.h
2  *  \brief Handling EXIF tags
3  */
4 /*
5  * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA  02110-1301  USA.
21  */
22 
23 #ifndef LIBEXIF_EXIF_TAG_H
24 #define LIBEXIF_EXIF_TAG_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29 
30 #include <libexif/exif-ifd.h>
31 #include <libexif/exif-data-type.h>
32 
33 /*! EXIF tags */
34 typedef enum {
35 	EXIF_TAG_GPS_VERSION_ID        = 0x0000,
36 	EXIF_TAG_GPS_LATITUDE_REF      = 0x0001, /* INTEROPERABILITY_INDEX   */
37 	EXIF_TAG_GPS_LATITUDE          = 0x0002, /* INTEROPERABILITY_VERSION */
38 	EXIF_TAG_GPS_LONGITUDE_REF     = 0x0003,
39 	EXIF_TAG_GPS_LONGITUDE         = 0x0004,
40 	EXIF_TAG_GPS_ALTITUDE_REF      = 0x0005,
41 	EXIF_TAG_GPS_ALTITUDE          = 0x0006,
42 	EXIF_TAG_GPS_TIME_STAMP        = 0x0007,
43 	EXIF_TAG_GPS_SATELLITES        = 0x0008,
44 	EXIF_TAG_GPS_STATUS            = 0x0009,
45 	EXIF_TAG_GPS_MEASURE_MODE      = 0x000a,
46 	EXIF_TAG_GPS_DOP               = 0x000b,
47 	EXIF_TAG_GPS_SPEED_REF         = 0x000c,
48 	EXIF_TAG_GPS_SPEED             = 0x000d,
49 	EXIF_TAG_GPS_TRACK_REF         = 0x000e,
50 	EXIF_TAG_GPS_TRACK             = 0x000f,
51 	EXIF_TAG_GPS_IMG_DIRECTION_REF = 0x0010,
52 	EXIF_TAG_GPS_IMG_DIRECTION     = 0x0011,
53 	EXIF_TAG_GPS_MAP_DATUM         = 0x0012,
54 	EXIF_TAG_GPS_DEST_LATITUDE_REF = 0x0013,
55 	EXIF_TAG_GPS_DEST_LATITUDE     = 0x0014,
56 	EXIF_TAG_GPS_DEST_LONGITUDE_REF = 0x0015,
57 	EXIF_TAG_GPS_DEST_LONGITUDE     = 0x0016,
58 	EXIF_TAG_GPS_DEST_BEARING_REF   = 0x0017,
59 	EXIF_TAG_GPS_DEST_BEARING       = 0x0018,
60 	EXIF_TAG_GPS_DEST_DISTANCE_REF  = 0x0019,
61 	EXIF_TAG_GPS_DEST_DISTANCE      = 0x001a,
62 	EXIF_TAG_GPS_PROCESSING_METHOD  = 0x001b,
63 	EXIF_TAG_GPS_AREA_INFORMATION   = 0x001c,
64 	EXIF_TAG_GPS_DATE_STAMP         = 0x001d,
65 	EXIF_TAG_GPS_DIFFERENTIAL       = 0x001e,
66 	EXIF_TAG_GPS_H_POSITIONING_ERROR = 0x001f,
67 	EXIF_TAG_INTEROPERABILITY_INDEX		= 0x0001,
68 	EXIF_TAG_INTEROPERABILITY_VERSION	= 0x0002,
69 	EXIF_TAG_NEW_SUBFILE_TYPE		= 0x00fe,
70 	EXIF_TAG_OLD_SUBFILE_TYPE		= 0x00ff,
71 	EXIF_TAG_IMAGE_WIDTH 			= 0x0100,
72 	EXIF_TAG_IMAGE_LENGTH 			= 0x0101,
73 	EXIF_TAG_BITS_PER_SAMPLE 		= 0x0102,
74 	EXIF_TAG_COMPRESSION 			= 0x0103,
75 	EXIF_TAG_PHOTOMETRIC_INTERPRETATION 	= 0x0106,
76 	EXIF_TAG_FILL_ORDER 			= 0x010a,
77 	EXIF_TAG_DOCUMENT_NAME 			= 0x010d,
78 	EXIF_TAG_IMAGE_DESCRIPTION 		= 0x010e,
79 	EXIF_TAG_MAKE 					= 0x010f,
80 	EXIF_TAG_MODEL 					= 0x0110,
81 	EXIF_TAG_STRIP_OFFSETS 			= 0x0111,
82 	EXIF_TAG_ORIENTATION 			= 0x0112,
83 	EXIF_TAG_SAMPLES_PER_PIXEL 		= 0x0115,
84 	EXIF_TAG_ROWS_PER_STRIP 		= 0x0116,
85 	EXIF_TAG_STRIP_BYTE_COUNTS		= 0x0117,
86 	EXIF_TAG_X_RESOLUTION 			= 0x011a,
87 	EXIF_TAG_Y_RESOLUTION 			= 0x011b,
88 	EXIF_TAG_PLANAR_CONFIGURATION 	= 0x011c,
89 	EXIF_TAG_RESOLUTION_UNIT 		= 0x0128,
90 	EXIF_TAG_TRANSFER_FUNCTION 		= 0x012d,
91 	EXIF_TAG_SOFTWARE 				= 0x0131,
92 	EXIF_TAG_DATE_TIME				= 0x0132,
93 	EXIF_TAG_ARTIST					= 0x013b,
94 	EXIF_TAG_WHITE_POINT			= 0x013e,
95 	EXIF_TAG_PRIMARY_CHROMATICITIES	= 0x013f,
96 	EXIF_TAG_SUB_IFDS				= 0x014a,
97 	EXIF_TAG_TRANSFER_RANGE			= 0x0156,
98 	EXIF_TAG_JPEG_PROC				= 0x0200,
99 	EXIF_TAG_JPEG_INTERCHANGE_FORMAT		= 0x0201,
100 	EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH	= 0x0202,
101 	EXIF_TAG_YCBCR_COEFFICIENTS		= 0x0211,
102 	EXIF_TAG_YCBCR_SUB_SAMPLING		= 0x0212,
103 	EXIF_TAG_YCBCR_POSITIONING		= 0x0213,
104 	EXIF_TAG_REFERENCE_BLACK_WHITE	= 0x0214,
105 	EXIF_TAG_XML_PACKET				= 0x02bc,
106 	EXIF_TAG_RELATED_IMAGE_FILE_FORMAT	= 0x1000,
107 	EXIF_TAG_RELATED_IMAGE_WIDTH		= 0x1001,
108 	EXIF_TAG_RELATED_IMAGE_LENGTH		= 0x1002,
109 	EXIF_TAG_IMAGE_DEPTH			= 0x80e5,
110 	EXIF_TAG_CFA_REPEAT_PATTERN_DIM	= 0x828d,
111 	EXIF_TAG_CFA_PATTERN			= 0x828e,
112 	EXIF_TAG_BATTERY_LEVEL			= 0x828f,
113 	EXIF_TAG_COPYRIGHT				= 0x8298,
114 	EXIF_TAG_EXPOSURE_TIME			= 0x829a,
115 	EXIF_TAG_FNUMBER				= 0x829d,
116 	EXIF_TAG_IPTC_NAA				= 0x83bb,
117 	EXIF_TAG_IMAGE_RESOURCES		= 0x8649,
118 	EXIF_TAG_EXIF_IFD_POINTER		= 0x8769,
119 	EXIF_TAG_INTER_COLOR_PROFILE	= 0x8773,
120 	EXIF_TAG_EXPOSURE_PROGRAM		= 0x8822,
121 	EXIF_TAG_SPECTRAL_SENSITIVITY	= 0x8824,
122 	EXIF_TAG_GPS_INFO_IFD_POINTER	= 0x8825,
123 	EXIF_TAG_ISO_SPEED_RATINGS		= 0x8827,
124 	EXIF_TAG_OECF					= 0x8828,
125 	EXIF_TAG_TIME_ZONE_OFFSET		= 0x882a,
126 	EXIF_TAG_SENSITIVITY_TYPE		= 0x8830,
127 	EXIF_TAG_STANDARD_OUTPUT_SENSITIVITY	= 0x8831,
128 	EXIF_TAG_RECOMMENDED_EXPOSURE_INDEX		= 0x8832,
129 	EXIF_TAG_ISO_SPEED				= 0x8833,
130 	EXIF_TAG_ISO_SPEEDLatitudeYYY	= 0x8834,
131 	EXIF_TAG_ISO_SPEEDLatitudeZZZ	= 0x8835,
132 	EXIF_TAG_EXIF_VERSION			= 0x9000,
133 	EXIF_TAG_DATE_TIME_ORIGINAL		= 0x9003,
134 	EXIF_TAG_DATE_TIME_DIGITIZED	= 0x9004,
135 	EXIF_TAG_OFFSET_TIME			= 0x9010,
136 	EXIF_TAG_OFFSET_TIME_ORIGINAL		= 0x9011,
137 	EXIF_TAG_OFFSET_TIME_DIGITIZED		= 0x9012,
138 	EXIF_TAG_COMPONENTS_CONFIGURATION	= 0x9101,
139 	EXIF_TAG_COMPRESSED_BITS_PER_PIXEL	= 0x9102,
140 	EXIF_TAG_SHUTTER_SPEED_VALUE		= 0x9201,
141 	EXIF_TAG_APERTURE_VALUE			= 0x9202,
142 	EXIF_TAG_BRIGHTNESS_VALUE		= 0x9203,
143 	EXIF_TAG_EXPOSURE_BIAS_VALUE	= 0x9204,
144 	EXIF_TAG_MAX_APERTURE_VALUE		= 0x9205,
145 	EXIF_TAG_SUBJECT_DISTANCE		= 0x9206,
146 	EXIF_TAG_METERING_MODE			= 0x9207,
147 	EXIF_TAG_LIGHT_SOURCE			= 0x9208,
148 	EXIF_TAG_FLASH					= 0x9209,
149 	EXIF_TAG_FOCAL_LENGTH			= 0x920a,
150 	EXIF_TAG_SUBJECT_AREA			= 0x9214,
151 	EXIF_TAG_TIFF_EP_STANDARD_ID	= 0x9216,
152 	EXIF_TAG_MAKER_NOTE				= 0x927c,
153 	EXIF_TAG_USER_COMMENT			= 0x9286,
154 	EXIF_TAG_SUB_SEC_TIME			= 0x9290,
155 	EXIF_TAG_SUB_SEC_TIME_ORIGINAL	= 0x9291,
156 	EXIF_TAG_SUB_SEC_TIME_DIGITIZED	= 0x9292,
157 	EXIF_TAG_XP_TITLE				= 0x9c9b,
158 	EXIF_TAG_XP_COMMENT				= 0x9c9c,
159 	EXIF_TAG_XP_AUTHOR				= 0x9c9d,
160 	EXIF_TAG_XP_KEYWORDS			= 0x9c9e,
161 	EXIF_TAG_XP_SUBJECT				= 0x9c9f,
162 	EXIF_TAG_FLASH_PIX_VERSION		= 0xa000,
163 	EXIF_TAG_COLOR_SPACE			= 0xa001,
164 	EXIF_TAG_PIXEL_X_DIMENSION		= 0xa002,
165 	EXIF_TAG_PIXEL_Y_DIMENSION		= 0xa003,
166 	EXIF_TAG_RELATED_SOUND_FILE		= 0xa004,
167 	EXIF_TAG_INTEROPERABILITY_IFD_POINTER	= 0xa005,
168 	EXIF_TAG_FLASH_ENERGY			= 0xa20b,
169 	EXIF_TAG_SPATIAL_FREQUENCY_RESPONSE	= 0xa20c,
170 	EXIF_TAG_FOCAL_PLANE_X_RESOLUTION	= 0xa20e,
171 	EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION	= 0xa20f,
172 	EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT= 0xa210,
173 	EXIF_TAG_SUBJECT_LOCATION		= 0xa214,
174 	EXIF_TAG_EXPOSURE_INDEX			= 0xa215,
175 	EXIF_TAG_SENSING_METHOD			= 0xa217,
176 	EXIF_TAG_FILE_SOURCE			= 0xa300,
177 	EXIF_TAG_SCENE_TYPE				= 0xa301,
178 	EXIF_TAG_NEW_CFA_PATTERN		= 0xa302,
179 	EXIF_TAG_CUSTOM_RENDERED		= 0xa401,
180 	EXIF_TAG_EXPOSURE_MODE			= 0xa402,
181 	EXIF_TAG_WHITE_BALANCE			= 0xa403,
182 	EXIF_TAG_DIGITAL_ZOOM_RATIO		= 0xa404,
183 	EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM	= 0xa405,
184 	EXIF_TAG_SCENE_CAPTURE_TYPE			= 0xa406,
185 	EXIF_TAG_GAIN_CONTROL				= 0xa407,
186 	EXIF_TAG_CONTRAST				= 0xa408,
187 	EXIF_TAG_SATURATION				= 0xa409,
188 	EXIF_TAG_SHARPNESS				= 0xa40a,
189 	EXIF_TAG_DEVICE_SETTING_DESCRIPTION	= 0xa40b,
190 	EXIF_TAG_SUBJECT_DISTANCE_RANGE		= 0xa40c,
191 	EXIF_TAG_IMAGE_UNIQUE_ID			= 0xa420,
192 	EXIF_TAG_CAMERA_OWNER_NAME 			= 0xa430,
193 	EXIF_TAG_BODY_SERIAL_NUMBER 		= 0xa431,
194 	EXIF_TAG_LENS_SPECIFICATION 		= 0xa432,
195 	EXIF_TAG_LENS_MAKE	 				= 0xa433,
196 	EXIF_TAG_LENS_MODEL	 				= 0xa434,
197 	EXIF_TAG_LENS_SERIAL_NUMBER 		= 0xa435,
198 	EXIF_TAG_COMPOSITE_IMAGE 			= 0xa460,
199 	EXIF_TAG_SOURCE_IMAGE_NUMBER_OF_COMPOSITE_IMAGE 		= 0xa461,
200 	EXIF_TAG_SOURCE_EXPOSURE_TIMES_OF_COMPOSITE_IMAGE 		= 0xa462,
201 	EXIF_TAG_GAMMA						= 0xa500,
202 	EXIF_TAG_PRINT_IMAGE_MATCHING		= 0xc4a5,
203 	EXIF_TAG_PADDING					= 0xea1c,
204 	EXIF_TAG_DEFALUT_CROP_SIZE  		= 0xc620,
205 	EXIF_TAG_DNG_VERSION				= 0xc612,
206 	EXIF_TAG_ISO_SPEED_LATITUDE_YYY		= 0x8834,
207 	EXIF_TAG_ISO_SPEED_LATITUDE_ZZZ		= 0x8835,
208 } ExifTag;
209 
210 /* GPS tags overlap with above ones. */
211 
212 
213 /*! What level of support a tag enjoys in the EXIF standard */
214 typedef enum {
215 	/*! The meaning of this tag is unknown */
216 	EXIF_SUPPORT_LEVEL_UNKNOWN = 0,
217 
218 	/*! This tag is not allowed in the given IFD */
219 	EXIF_SUPPORT_LEVEL_NOT_RECORDED,
220 
221 	/*! This tag is mandatory in the given IFD */
222 	EXIF_SUPPORT_LEVEL_MANDATORY,
223 
224 	/*! This tag is optional in the given IFD */
225 	EXIF_SUPPORT_LEVEL_OPTIONAL
226 } ExifSupportLevel;
227 
228 /*! Return the tag ID given its unique textual name.
229  *
230  * \param[in] name tag name
231  * \return tag ID, or 0 if tag not found
232  * \note The tag not found value cannot be distinguished from a legitimate
233  *   tag number 0.
234  */
235 ExifTag          exif_tag_from_name(const char *name);
236 ExifIfd          exif_ifd_from_name(const char* name);
237 
238 /*! Return a textual name of the given tag when found in the given IFD. The
239  * name is a short, unique, non-localized text string containing only
240  * US-ASCII alphanumeric characters.
241  *
242  * \param[in] tag EXIF tag
243  * \param[in] ifd IFD
244  * \return textual name of the tag, or NULL if the tag is unknown
245  */
246 const char      *exif_tag_get_name_in_ifd          (ExifTag tag, ExifIfd ifd);
247 
248 /*! Return a textual title of the given tag when found in the given IFD.
249  * The title is a short, localized description of the tag.
250  *
251  * \param[in] tag EXIF tag
252  * \param[in] ifd IFD
253  * \return textual title of the tag, or NULL if the tag is unknown
254  */
255 const char      *exif_tag_get_title_in_ifd         (ExifTag tag, ExifIfd ifd);
256 
257 /*! Return a verbose textual description of the given tag when found in the
258  * given IFD. The description is a verbose, localized description of the tag.
259  *
260  * \param[in] tag EXIF tag
261  * \param[in] ifd IFD
262  * \return textual description of the tag, or NULL if the tag is unknown
263  */
264 const char      *exif_tag_get_description_in_ifd   (ExifTag tag, ExifIfd ifd);
265 
266 /*! Return whether the given tag is mandatory or not in the given IFD and
267  * data type according to the EXIF specification. If the IFD given is
268  * EXIF_IFD_COUNT, the result is EXIF_SUPPORT_LEVEL_UNKNOWN. If the data
269  * type is EXIF_DATA_TYPE_UNKNOWN, the result is
270  * EXIF_SUPPORT_LEVEL_UNKNOWN unless the support level is the same for
271  * all data types.
272  *
273  * \param[in] tag EXIF tag
274  * \param[in] ifd IFD or EXIF_IFD_COUNT
275  * \param[in] t data type or EXIF_DATA_TYPE_UNKNOWN
276  * \return the level of support for this tag
277  */
278 ExifSupportLevel exif_tag_get_support_level_in_ifd (ExifTag tag, ExifIfd ifd,
279                                                     ExifDataType t);
280 
281 /* Don't use these functions. They are here for compatibility only. */
282 
283 /*! \deprecated Use #exif_tag_get_name_in_ifd instead */
284 const char     *exif_tag_get_name        (ExifTag tag);
285 
286 /*! \deprecated Use #exif_tag_get_title_in_ifd instead */
287 const char     *exif_tag_get_title       (ExifTag tag);
288 
289 /*! \deprecated Use #exif_tag_get_description_in_ifd instead */
290 const char     *exif_tag_get_description (ExifTag tag);
291 
292 
293 /* For now, do not use these functions. */
294 
295 /*! \internal */
296 ExifTag      exif_tag_table_get_tag  (unsigned int n);
297 
298 /*! \internal */
299 const char  *exif_tag_table_get_name (unsigned int n);
300 
301 /*! \internal */
302 unsigned int exif_tag_table_count    (void);
303 
304 
305 /* Don't use these definitions. They are here for compatibility only. */
306 
307 /*! \deprecated Use EXIF_TAG_PRINT_IMAGE_MATCHING instead. */
308 #define EXIF_TAG_UNKNOWN_C4A5 EXIF_TAG_PRINT_IMAGE_MATCHING
309 
310 #ifdef __cplusplus
311 }
312 #endif /* __cplusplus */
313 
314 #endif /* !defined(LIBEXIF_EXIF_TAG_H) */
315