6 * Support for Exif file format, originally written by Eric Swalens.
7 * Modified by Quy Tonthat
8 * Reimplemented with generic data storage by John Ellis
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32 *-----------------------------------------------------------------------------
34 *-----------------------------------------------------------------------------
38 EXIF_BYTE_ORDER_INTEL,
39 EXIF_BYTE_ORDER_MOTOROLA
42 typedef struct _ExifFormatAttrib ExifFormatAttrib;
43 struct _ExifFormatAttrib
47 const gchar *short_name;
48 const gchar *description;
51 /* the list of known tag data formats */
52 extern ExifFormatAttrib ExifFormatList[];
56 *-----------------------------------------------------------------------------
58 *-----------------------------------------------------------------------------
61 typedef struct _ExifMarker ExifMarker;
62 typedef struct _ExifTextList ExifTextList;
66 GList *items; /* list of (ExifItem *) */
67 GList *current; /* for exif_get_next_item */
73 ExifFormatType format;
75 const ExifMarker *marker;
84 ExifFormatType format;
91 #define EXIF_MARKER_LIST_END { 0x0000, EXIF_FORMAT_UNKNOWN, 0, NULL, NULL, NULL }
96 const gchar* description;
99 #define EXIF_TEXT_LIST_END { -1, NULL }
105 *-----------------------------------------------------------------------------
107 *-----------------------------------------------------------------------------
112 /* the known exif tags list */
113 extern ExifMarker ExifKnownMarkersList[];
115 /* the unknown tags utilize this generic list */
116 extern ExifMarker ExifUnknownMarkersList[];
118 /* the list of specially formatted keys, for human readable output */
119 extern ExifFormattedText ExifFormattedList[];
123 *-----------------------------------------------------------------------------
125 *-----------------------------------------------------------------------------
129 /* usually for debugging to stdout */
130 void exif_write_data_list(ExifData *exif, FILE *f, gint human_readable_list);
134 /* These funcs for use by makernote/tiff parsers only */
136 #define EXIF_TIFF_MAX_LEVELS 4
138 #define EXIF_TIFD_OFFSET_TAG 0
139 #define EXIF_TIFD_OFFSET_FORMAT 2
140 #define EXIF_TIFD_OFFSET_COUNT 4
141 #define EXIF_TIFD_OFFSET_DATA 8
142 #define EXIF_TIFD_SIZE 12
145 guint16 exif_byte_get_int16(unsigned char *f, ExifByteOrder bo);
146 guint32 exif_byte_get_int32(unsigned char *f, ExifByteOrder bo);
147 void exif_byte_put_int16(unsigned char *f, guint16 n, ExifByteOrder bo);
148 void exif_byte_put_int32(unsigned char *f, guint32 n, ExifByteOrder bo);
150 ExifItem *exif_item_new(ExifFormatType format, guint tag,
151 guint elements, const ExifMarker *marker);
152 void exif_item_copy_data(ExifItem *item, void *src, guint len,
153 ExifFormatType src_format, ExifByteOrder bo);
155 gint exif_parse_IFD_table(ExifData *exif,
156 unsigned char *tiff, guint offset,
157 guint size, ExifByteOrder bo,
159 const ExifMarker *list);
161 gint exif_tiff_directory_offset(unsigned char *data, const guint len,
162 guint *offset, ExifByteOrder *bo);
163 gint exif_tiff_parse(ExifData *exif, unsigned char *tiff, guint size, ExifMarker *list);
165 gchar *exif_text_list_find_value(ExifTextList *list, guint value);