EXIF library (libexif) API 0.6.20
exif-data.h
Go to the documentation of this file.
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/exif-byte-order.h>
32#include <libexif/exif-data-type.h>
33#include <libexif/exif-ifd.h>
34#include <libexif/exif-log.h>
35#include <libexif/exif-tag.h>
36
38typedef struct _ExifData ExifData;
39typedef struct _ExifDataPrivate ExifDataPrivate;
40
43#include <libexif/exif-mem.h>
44
47{
49 ExifContent *ifd[EXIF_IFD_COUNT];
50
52 unsigned char *data;
53
55 unsigned int size;
56
57 ExifDataPrivate *priv;
58};
59
68
77
84ExifData *exif_data_new_from_file (const char *path);
85
92ExifData *exif_data_new_from_data (const unsigned char *data,
93 unsigned int size);
94
105void exif_data_load_data (ExifData *data, const unsigned char *d,
106 unsigned int size);
107
118void exif_data_save_data (ExifData *data, unsigned char **d,
119 unsigned int *ds);
120
121void exif_data_ref (ExifData *data);
122void exif_data_unref (ExifData *data);
123void exif_data_free (ExifData *data);
124
130ExifByteOrder exif_data_get_byte_order (ExifData *data);
131
139void exif_data_set_byte_order (ExifData *data, ExifByteOrder order);
140
150
158void exif_data_fix (ExifData *d);
159
160typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data);
161
169 ExifDataForeachContentFunc func,
170 void *user_data);
171
173typedef enum {
176
179
183
190
197
204
211
217void exif_data_set_data_type (ExifData *d, ExifDataType dt);
218
224ExifDataType exif_data_get_data_type (ExifData *d);
225
231void exif_data_dump (ExifData *data);
232
238void exif_data_log (ExifData *data, ExifLog *log);
239
248#define exif_data_get_entry(d,t) \
249 (exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ? \
250 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) : \
251 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ? \
252 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) : \
253 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ? \
254 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) : \
255 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ? \
256 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) : \
257 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ? \
258 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
259
260#ifdef __cplusplus
261}
262#endif /* __cplusplus */
263
264#endif /* __EXIF_DATA_H__ */
Handling EXIF IFDs.
void exif_data_set_byte_order(ExifData *data, ExifByteOrder order)
Set the byte order to use for this EXIF data.
Definition: exif-data.c:1123
ExifByteOrder exif_data_get_byte_order(ExifData *data)
Return the byte order in use by this EXIF structure.
Definition: exif-data.c:1079
ExifDataOption
Options to configure the behaviour of ExifData.
Definition: exif-data.h:173
@ EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE
Leave the MakerNote alone, which could cause it to be corrupted.
Definition: exif-data.h:181
@ EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS
Act as though unknown tags are not present.
Definition: exif-data.h:175
@ EXIF_DATA_OPTION_FOLLOW_SPECIFICATION
Fix the EXIF tags to follow the spec.
Definition: exif-data.h:178
ExifMnoteData * exif_data_get_mnote_data(ExifData *d)
Return the MakerNote data out of the EXIF data.
Definition: exif-data.c:86
ExifDataType exif_data_get_data_type(ExifData *d)
Return the data type for the given ExifData.
Definition: exif-data.c:1263
const char * exif_data_option_get_description(ExifDataOption o)
Return a verbose textual description of the given ExifDataOption.
Definition: exif-data.c:1191
const char * exif_data_option_get_name(ExifDataOption o)
Return a short textual description of the given ExifDataOption.
Definition: exif-data.c:1180
ExifData * exif_data_new(void)
Allocate a new ExifData.
Definition: exif-data.c:92
ExifData * exif_data_new_from_data(const unsigned char *data, unsigned int size)
Allocate a new ExifData and load EXIF data from a memory buffer.
Definition: exif-data.c:150
void exif_data_fix(ExifData *d)
Fix the EXIF data to bring it into specification.
Definition: exif-data.c:1248
void exif_data_dump(ExifData *data)
Dump all EXIF data to stdout.
Definition: exif-data.c:1052
void exif_data_unset_option(ExifData *d, ExifDataOption o)
Clear the given option on the given ExifData.
Definition: exif-data.c:1211
void exif_data_set_data_type(ExifData *d, ExifDataType dt)
Set the data type for the given ExifData.
Definition: exif-data.c:1254
ExifData * exif_data_new_from_file(const char *path)
Allocate a new ExifData and load EXIF data from a JPEG file.
Definition: exif-data.c:981
void exif_data_save_data(ExifData *data, unsigned char **d, unsigned int *ds)
Store raw EXIF data representing the ExifData structure into a memory buffer.
Definition: exif-data.c:936
void exif_data_foreach_content(ExifData *data, ExifDataForeachContentFunc func, void *user_data)
Execute a function on each IFD in turn.
Definition: exif-data.c:1088
ExifData * exif_data_new_mem(ExifMem *)
Allocate a new ExifData using the given memory allocator.
Definition: exif-data.c:103
void exif_data_load_data(ExifData *data, const unsigned char *d, unsigned int size)
Load the ExifData structure from the raw JPEG or EXIF data in the given memory buffer.
Definition: exif-data.c:783
void exif_data_log(ExifData *data, ExifLog *log)
Set the log message object for all IFDs.
Definition: exif-data.c:1139
void exif_data_set_option(ExifData *d, ExifDataOption o)
Set the given option on the given ExifData.
Definition: exif-data.c:1202
Log message infrastructure.
struct _ExifLog ExifLog
State maintained by the logging interface.
Definition: exif-log.h:34
Define the ExifMem data type and the associated functions.
struct _ExifMem ExifMem
ExifMem define a memory allocator.
Definition: exif-mem.h:57
Handling EXIF MakerNote tags.
Handling EXIF tags.
Definition: exif-content.h:41
Represents the entire EXIF data found in an image.
Definition: exif-data.h:47
unsigned char * data
Pointer to thumbnail image, or NULL if not available.
Definition: exif-data.h:52
unsigned int size
Number of bytes in thumbnail image at data.
Definition: exif-data.h:55
ExifContent * ifd[EXIF_IFD_COUNT]
Data for each IFD.
Definition: exif-data.h:49
Definition: exif-mnote-data-priv.h:61