4 * Copyright (C) 2008 - 2012 The Geeqie Team
7 * Support for Exif file format, originally written by Eric Swalens.
8 * Modified by Quy Tonthat
9 * Reimplemented with generic data storage by John Ellis
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 *-----------------------------------------------------------------------------
35 *-----------------------------------------------------------------------------
39 EXIF_BYTE_ORDER_INTEL,
40 EXIF_BYTE_ORDER_MOTOROLA
43 typedef struct _ExifFormatAttrib ExifFormatAttrib;
44 struct _ExifFormatAttrib
48 const gchar *short_name;
49 const gchar *description;
52 /* the list of known tag data formats */
53 extern ExifFormatAttrib ExifFormatList[];
57 *-----------------------------------------------------------------------------
59 *-----------------------------------------------------------------------------
62 typedef struct _ExifMarker ExifMarker;
63 typedef struct _ExifTextList ExifTextList;
68 GList *items; /* list of (ExifItem *) */
69 GList *current; /* for exif_get_next_item */
75 ExifFormatType format;
77 const ExifMarker *marker;
86 ExifFormatType format;
93 #define EXIF_MARKER_LIST_END { 0x0000, EXIF_FORMAT_UNKNOWN, 0, NULL, NULL, NULL }
98 const gchar *description;
101 #define EXIF_TEXT_LIST_END { -1, NULL }
107 *-----------------------------------------------------------------------------
109 *-----------------------------------------------------------------------------
114 /* the known exif tags list */
115 extern ExifMarker ExifKnownMarkersList[];
117 /* the unknown tags utilize this generic list */
118 extern ExifMarker ExifUnknownMarkersList[];
120 /* the list of specially formatted keys, for human readable output */
121 extern ExifFormattedText ExifFormattedList[];
125 *-----------------------------------------------------------------------------
127 *-----------------------------------------------------------------------------
131 /* usually for debugging to stdout */
132 void exif_write_data_list(ExifData *exif, FILE *f, gint human_readable_list);
136 /* These funcs for use by makernote/tiff parsers only */
138 #define EXIF_TIFF_MAX_LEVELS 4
140 #define EXIF_TIFD_OFFSET_TAG 0
141 #define EXIF_TIFD_OFFSET_FORMAT 2
142 #define EXIF_TIFD_OFFSET_COUNT 4
143 #define EXIF_TIFD_OFFSET_DATA 8
144 #define EXIF_TIFD_SIZE 12
147 guint16 exif_byte_get_int16(guchar *f, ExifByteOrder bo);
148 guint32 exif_byte_get_int32(guchar *f, ExifByteOrder bo);
149 void exif_byte_put_int16(guchar *f, guint16 n, ExifByteOrder bo);
150 void exif_byte_put_int32(guchar *f, guint32 n, ExifByteOrder bo);
152 ExifItem *exif_item_new(ExifFormatType format, guint tag,
153 guint elements, const ExifMarker *marker);
154 void exif_item_copy_data(ExifItem *item, gpointer src, guint len,
155 ExifFormatType src_format, ExifByteOrder bo);
157 gint exif_parse_IFD_table(ExifData *exif,
158 guchar *tiff, guint offset,
159 guint size, ExifByteOrder bo,
161 const ExifMarker *list);
163 gint exif_tiff_directory_offset(guchar *data, const guint len,
164 guint *offset, ExifByteOrder *bo);
165 gint exif_tiff_parse(ExifData *exif, guchar *tiff, guint size, ExifMarker *list);
167 gchar *exif_text_list_find_value(ExifTextList *list, guint value);
170 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */