2 * Copyright (C) 2006 John Ellis
3 * Copyright (C) 2008 - 2016 The Geeqie Team
5 * Authors: Eric Swalens, Quy Tonthat, John Ellis
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 *-----------------------------------------------------------------------------
30 *-----------------------------------------------------------------------------
34 EXIF_BYTE_ORDER_INTEL,
35 EXIF_BYTE_ORDER_MOTOROLA
38 typedef struct _ExifFormatAttrib ExifFormatAttrib;
39 struct _ExifFormatAttrib
43 const gchar *short_name;
44 const gchar *description;
47 /* the list of known tag data formats */
48 extern ExifFormatAttrib ExifFormatList[];
52 *-----------------------------------------------------------------------------
54 *-----------------------------------------------------------------------------
57 typedef struct _ExifMarker ExifMarker;
58 typedef struct _ExifTextList ExifTextList;
63 GList *items; /* list of (ExifItem *) */
64 GList *current; /* for exif_get_next_item */
70 ExifFormatType format;
72 const ExifMarker *marker;
81 ExifFormatType format;
88 #define EXIF_MARKER_LIST_END { 0x0000, EXIF_FORMAT_UNKNOWN, 0, NULL, NULL, NULL }
93 const gchar *description;
96 #define EXIF_TEXT_LIST_END { -1, NULL }
102 *-----------------------------------------------------------------------------
104 *-----------------------------------------------------------------------------
109 /* the known exif tags list */
110 extern ExifMarker ExifKnownMarkersList[];
112 /* the unknown tags utilize this generic list */
113 extern ExifMarker ExifUnknownMarkersList[];
115 /* the list of specially formatted keys, for human readable output */
116 extern ExifFormattedText ExifFormattedList[];
120 *-----------------------------------------------------------------------------
122 *-----------------------------------------------------------------------------
126 /* usually for debugging to stdout */
127 void exif_write_data_list(ExifData *exif, FILE *f, gint human_readable_list);
131 /* These funcs for use by makernote/tiff parsers only */
133 #define EXIF_TIFF_MAX_LEVELS 4
135 #define EXIF_TIFD_OFFSET_TAG 0
136 #define EXIF_TIFD_OFFSET_FORMAT 2
137 #define EXIF_TIFD_OFFSET_COUNT 4
138 #define EXIF_TIFD_OFFSET_DATA 8
139 #define EXIF_TIFD_SIZE 12
142 guint16 exif_byte_get_int16(guchar *f, ExifByteOrder bo);
143 guint32 exif_byte_get_int32(guchar *f, ExifByteOrder bo);
144 void exif_byte_put_int16(guchar *f, guint16 n, ExifByteOrder bo);
145 void exif_byte_put_int32(guchar *f, guint32 n, ExifByteOrder bo);
147 ExifItem *exif_item_new(ExifFormatType format, guint tag,
148 guint elements, const ExifMarker *marker);
149 void exif_item_copy_data(ExifItem *item, gpointer src, guint len,
150 ExifFormatType src_format, ExifByteOrder bo);
152 gint exif_parse_IFD_table(ExifData *exif,
153 guchar *tiff, guint offset,
154 guint size, ExifByteOrder bo,
156 const ExifMarker *list);
158 gint exif_tiff_directory_offset(guchar *data, const guint len,
159 guint *offset, ExifByteOrder *bo);
160 gint exif_tiff_parse(ExifData *exif, guchar *tiff, guint size, ExifMarker *list);
162 gchar *exif_text_list_find_value(ExifTextList *list, guint value);
165 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */