EXIF library (libexif) API: libexif/exifdata.h Source File

EXIF library (libexif) API 0.6.22

exifdata.h
1
4/*
5 * \author Lutz Mueller <lutz@users.sourceforge.net>
6 * \date 2001-2005
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 */
23
24#ifndef __EXIF_DATA_H__
25#define __EXIF_DATA_H__
26
27#ifdef __cplusplus
28extern "C" {
29#endif /* __cplusplus */
30
31#include <libexif/exifutil.h>
32#include <libexif/exifbyte.h>
33#include <libexif/exifdata.h>
34#include <libexif/exififd.h>
35#include <libexif/exiflog.h>
36#include <libexif/exiftag.h>
37
39typedef struct _ExifData ExifData;
40typedef struct _ExifDataPrivate ExifDataPrivate;
41
42#include <libexif/exifcont.h>
43#include <libexif/exifnote.h>
44#include <libexif/exifmem.h>
45
47struct _ExifData
48{
50 ExifContent *ifd[EXIF_IFD_COUNT];
51
53 unsigned char *data;
54
56 uint32_t size;
57
58 ExifDataPrivate *priv;
59};
60
68EXIF_API(ExifData *) exif_data_new (void);
69
77EXIF_API(ExifData *) exif_data_new_mem (ExifMem *);
78
85EXIF_API(ExifData *) exif_data_new_from_file (const char *path);
86
93EXIF_API(ExifData *) exif_data_new_from_data (const unsigned char *data, uint32_t size);
94
106EXIF_API(void) exif_data_load_data (ExifData *data, const unsigned char *d, uint32_t size);
107
118EXIF_API(void) exif_data_save_data (ExifData *data, unsigned char **d, uint32_t *ds);
119
120EXIF_API(void) exif_data_ref (ExifData *data);
121EXIF_API(void) exif_data_unref (ExifData *data);
122EXIF_API(void) exif_data_free (ExifData *data);
123
129EXIF_API(ExifByteOrder) exif_data_get_byte_order (ExifData *data);
130
138EXIF_API(void) exif_data_set_byte_order (ExifData *data, exif_enum(ExifByteOrder) order);
139
148EXIF_API(ExifMnoteData *) exif_data_get_mnote_data (ExifData *d);
149
157EXIF_API(void) exif_data_fix (ExifData *d);
158
159typedef void EXIF_CALLBACK (*ExifDataForeachContentFunc) (ExifContent *, void *user_data);
160
167EXIF_API(void) exif_data_foreach_content (ExifData *data, ExifDataForeachContentFunc func, void *user_data);
168
170typedef enum {
172 EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0,
173
175 EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1,
176
178 EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2
179} ExifDataOption;
180
187EXIF_API(const char *) exif_data_option_get_name(exif_enum(ExifDataOption) o);
188
195EXIF_API(const char *) exif_data_option_get_description (exif_enum(ExifDataOption) o);
196
202EXIF_API(void) exif_data_set_option (ExifData *d, exif_enum(ExifDataOption) o);
203
209EXIF_API(void) exif_data_unset_option (ExifData *d, exif_enum(ExifDataOption) o);
210
216EXIF_API(void) exif_data_set_data_type (ExifData *d, exif_enum(ExifDataType) dt);
217
223EXIF_API(ExifDataType) exif_data_get_data_type (ExifData *d);
224
230EXIF_API(void) exif_data_dump (ExifData *data);
231
237EXIF_API(void) exif_data_log (ExifData *data, ExifLog *log);
238
247#define exif_data_get_entry(d,t) \
248 (exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ? \
249 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) : \
250 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ? \
251 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) : \
252 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ? \
253 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) : \
254 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ? \
255 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) : \
256 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ? \
257 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
258
259#if defined(__PUREC__) && !defined(BUILDING_LIBEXIF)
260struct _ExifEntryPrivate { int dummy; };
261struct _ExifDataPrivate { int dummy; };
262struct _ExifMnoteData { int dummy; };
263struct _ExifContentPrivate { int dummy; };
264struct _ExifLog { int dummy; };
265struct _ExifMem { int dummy; };
266struct _ExifLoader { int dummy; };
267#endif
268
269#ifdef __cplusplus
270}
271#endif /* __cplusplus */
272
273#endif /* __EXIF_DATA_H__ */
ExifDataOption
ExifDataOption
Options to configure the behaviour of ExifData.
Definition: exif-data.h:170
EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE
@ EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE
Leave the MakerNote alone, which could cause it to be corrupted.
Definition: exif-data.h:178
EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS
@ EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS
Act as though unknown tags are not present.
Definition: exif-data.h:172
EXIF_DATA_OPTION_FOLLOW_SPECIFICATION
@ EXIF_DATA_OPTION_FOLLOW_SPECIFICATION
Fix the EXIF tags to follow the spec.
Definition: exif-data.h:175
exifbyte.h
Defines the ExifByteOrder enum and the associated functions.
exifcont.h
Handling EXIF IFDs.
_ExifContent
Definition: exif-content.h:41
_ExifData
Represents the entire EXIF data found in an image.
Definition: exif-data.h:48
_ExifData::size
uint32_t size
Number of bytes in thumbnail image at data.
Definition: exif-data.h:56
_ExifData::data
unsigned char * data
Pointer to thumbnail image, or NULL if not available.
Definition: exif-data.h:53
_ExifData::ifd
ExifContent * ifd[EXIF_IFD_COUNT]
Data for each IFD.
Definition: exif-data.h:50
_ExifMnoteData
Definition: exif-mnote-data-priv.h:61