annotate src/exif.h @ 257:c5422b69b40e

Re-add "What to show in properties dialog:" label before the table.
author zas_
date Fri, 04 Apr 2008 22:23:36 +0000
parents 0584cb78aa14
children 4b2d7f9af171
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2 * GQView
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 110
diff changeset
3 * (C) 2006 John Ellis
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
4 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 * Authors:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Support for Exif file format, originally written by Eric Swalens.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 * Modified by Quy Tonthat
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * Reimplemented with generic data storage by John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 This program is free software; you can redistribute it and/or modify
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12 it under the terms of the GNU General Public License as published by
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13 the Free Software Foundation; either version 2 of the License, or
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 (at your option) any later version.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 This program is distributed in the hope that it will be useful,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 GNU General Public License for more details.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 You should have received a copy of the GNU General Public License
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 along with this program; if not, write to the Free Software
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #ifndef __EXIF_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 #define __EXIF_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 * Tag formats
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35
54
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
36 #define EXIF_FORMAT_COUNT 13
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
37
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 typedef enum {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 EXIF_FORMAT_UNKNOWN = 0,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 EXIF_FORMAT_BYTE_UNSIGNED = 1,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 EXIF_FORMAT_STRING = 2,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 EXIF_FORMAT_SHORT_UNSIGNED = 3,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 EXIF_FORMAT_LONG_UNSIGNED = 4,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 EXIF_FORMAT_RATIONAL_UNSIGNED = 5,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 EXIF_FORMAT_BYTE = 6,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46 EXIF_FORMAT_UNDEFINED = 7,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 EXIF_FORMAT_SHORT = 8,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 EXIF_FORMAT_LONG = 9,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49 EXIF_FORMAT_RATIONAL = 10,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50 EXIF_FORMAT_FLOAT = 11,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 EXIF_FORMAT_DOUBLE = 12
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 } ExifFormatType;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53
178
9dc8bc9b2bb9 first exiv2 support that does not crash immediately
nadvornik
parents: 177
diff changeset
54
9dc8bc9b2bb9 first exiv2 support that does not crash immediately
nadvornik
parents: 177
diff changeset
55 typedef struct _ExifFormattedText ExifFormattedText;
9dc8bc9b2bb9 first exiv2 support that does not crash immediately
nadvornik
parents: 177
diff changeset
56 struct _ExifFormattedText
9dc8bc9b2bb9 first exiv2 support that does not crash immediately
nadvornik
parents: 177
diff changeset
57 {
9dc8bc9b2bb9 first exiv2 support that does not crash immediately
nadvornik
parents: 177
diff changeset
58 const gchar *key;
9dc8bc9b2bb9 first exiv2 support that does not crash immediately
nadvornik
parents: 177
diff changeset
59 const gchar *description;
9dc8bc9b2bb9 first exiv2 support that does not crash immediately
nadvornik
parents: 177
diff changeset
60 };
9dc8bc9b2bb9 first exiv2 support that does not crash immediately
nadvornik
parents: 177
diff changeset
61
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 * Data storage
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67
176
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
68 typedef struct _ExifItem ExifItem;
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
69
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 typedef struct _ExifData ExifData;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 typedef struct _ExifRational ExifRational;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73 struct _ExifRational
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 {
51
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 47
diff changeset
75 guint32 num;
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 47
diff changeset
76 guint32 den;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 /* enums useful for image manipulation */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82 typedef enum {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 EXIF_ORIENTATION_UNKNOWN = 0,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 EXIF_ORIENTATION_TOP_LEFT = 1,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 EXIF_ORIENTATION_TOP_RIGHT = 2,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86 EXIF_ORIENTATION_BOTTOM_RIGHT = 3,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87 EXIF_ORIENTATION_BOTTOM_LEFT = 4,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 EXIF_ORIENTATION_LEFT_TOP = 5,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 EXIF_ORIENTATION_RIGHT_TOP = 6,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90 EXIF_ORIENTATION_RIGHT_BOTTOM = 7,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 EXIF_ORIENTATION_LEFT_BOTTOM = 8
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 } ExifOrientationType;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94 typedef enum {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95 EXIF_UNIT_UNKNOWN = 0,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96 EXIF_UNIT_NOUNIT = 1,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97 EXIF_UNIT_INCH = 2,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98 EXIF_UNIT_CENTIMETER = 3
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 } ExifUnitType;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
102 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
103 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 * functions
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
106 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
107
188
0584cb78aa14 write comment and keywords to xmp, sidecars are used if exist
nadvornik
parents: 187
diff changeset
108 ExifData *exif_read(gchar *path, gchar *sidecar_path, gint parse_color_profile);
0584cb78aa14 write comment and keywords to xmp, sidecars are used if exist
nadvornik
parents: 187
diff changeset
109
0584cb78aa14 write comment and keywords to xmp, sidecars are used if exist
nadvornik
parents: 187
diff changeset
110 ExifData *exif_read_fd(FileData *fd, gint parse_color_profile);
0584cb78aa14 write comment and keywords to xmp, sidecars are used if exist
nadvornik
parents: 187
diff changeset
111
0584cb78aa14 write comment and keywords to xmp, sidecars are used if exist
nadvornik
parents: 187
diff changeset
112
187
9eafc4957f1a write support in Exiv2 wrapper; for now only string values
nadvornik
parents: 185
diff changeset
113 int exif_write(ExifData *exif);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
114 void exif_free(ExifData *exif);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
115
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
116 gchar *exif_get_data_as_text(ExifData *exif, const gchar *key);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117 gint exif_get_integer(ExifData *exif, const gchar *key, gint *value);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118 ExifRational *exif_get_rational(ExifData *exif, const gchar *key, gint *sign);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119 double exif_rational_to_double(ExifRational *r, gint sign);
182
8a417f10ba09 more exiv2 fixes
nadvornik
parents: 178
diff changeset
120 double exif_get_rational_as_double(ExifData *exif, const gchar *key);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
121
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122 ExifItem *exif_get_item(ExifData *exif, const gchar *key);
187
9eafc4957f1a write support in Exiv2 wrapper; for now only string values
nadvornik
parents: 185
diff changeset
123 ExifItem *exif_add_item(ExifData *exif, const gchar *key);
176
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
124 ExifItem *exif_get_first_item(ExifData *exif);
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
125 ExifItem *exif_get_next_item(ExifData *exif);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
126
187
9eafc4957f1a write support in Exiv2 wrapper; for now only string values
nadvornik
parents: 185
diff changeset
127
185
354da67a7ca2 read also iptc and xmp
nadvornik
parents: 182
diff changeset
128 char *exif_item_get_tag_name(ExifItem *item);
176
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
129 guint exif_item_get_tag_id(ExifItem *item);
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
130 guint exif_item_get_elements(ExifItem *item);
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
131 char *exif_item_get_data(ExifItem *item, guint *data_len);
182
8a417f10ba09 more exiv2 fixes
nadvornik
parents: 178
diff changeset
132 char *exif_item_get_description(ExifItem *item);
176
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
133 guint exif_item_get_format_id(ExifItem *item);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
134 const char *exif_item_get_format_name(ExifItem *item, gint brief);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
135 gchar *exif_item_get_data_as_text(ExifItem *item);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
136 gint exif_item_get_integer(ExifItem *item, gint *value);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
137 ExifRational *exif_item_get_rational(ExifItem *item, gint *sign);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
138
188
0584cb78aa14 write comment and keywords to xmp, sidecars are used if exist
nadvornik
parents: 187
diff changeset
139 gchar *exif_item_get_string(ExifItem *item, int idx);
0584cb78aa14 write comment and keywords to xmp, sidecars are used if exist
nadvornik
parents: 187
diff changeset
140
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
141 const gchar *exif_get_description_by_key(const gchar *key);
182
8a417f10ba09 more exiv2 fixes
nadvornik
parents: 178
diff changeset
142 const gchar *exif_get_tag_description_by_key(const gchar *key);
8a417f10ba09 more exiv2 fixes
nadvornik
parents: 178
diff changeset
143
8a417f10ba09 more exiv2 fixes
nadvornik
parents: 178
diff changeset
144 gchar *exif_get_formatted_by_key(ExifData *exif, const gchar *key, gint *key_valid);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
145
187
9eafc4957f1a write support in Exiv2 wrapper; for now only string values
nadvornik
parents: 185
diff changeset
146 int exif_item_delete(ExifData *exif, ExifItem *item);
9eafc4957f1a write support in Exiv2 wrapper; for now only string values
nadvornik
parents: 185
diff changeset
147 int exif_item_set_string(ExifItem *item, const char *str);
9eafc4957f1a write support in Exiv2 wrapper; for now only string values
nadvornik
parents: 185
diff changeset
148
9eafc4957f1a write support in Exiv2 wrapper; for now only string values
nadvornik
parents: 185
diff changeset
149
176
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
150 gint format_raw_img_exif_offsets_fd(int fd, const gchar *path,
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
151 unsigned char *header_data, const guint header_len,
695e1ad3b169 simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents: 138
diff changeset
152 guint *image_offset, guint *exif_offset);
57
a8c9992320f4 Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
153
47
aa4c0e1b54b0 Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
154
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
155 #endif
51
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 47
diff changeset
156