exif-data.h
Go to the documentation of this file.
/*
* \author Lutz Mueller <lutz@users.sourceforge.net>
* \date 2001-2005
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#ifndef __EXIF_DATA_H__
#define __EXIF_DATA_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <libexif/exif-byte-order.h>
#include <libexif/exif-data-type.h>
#include <libexif/exif-ifd.h>
#include <libexif/exif-log.h>
#include <libexif/exif-tag.h>
typedef struct _ExifData ExifData;
typedef struct _ExifDataPrivate ExifDataPrivate;
#include <libexif/exif-content.h>
#include <libexif/exif-mnote-data.h>
#include <libexif/exif-mem.h>
struct _ExifData
{
ExifContent *ifd[EXIF_IFD_COUNT];
unsigned char *data;
unsigned int size;
ExifDataPrivate *priv;
};
ExifData *exif_data_new (void);
ExifData *exif_data_new_mem (ExifMem *);
ExifData *exif_data_new_from_file (const char *path);
ExifData *exif_data_new_from_data (const unsigned char *data,
unsigned int size);
void exif_data_load_data (ExifData *data, const unsigned char *d,
unsigned int size);
void exif_data_save_data (ExifData *data, unsigned char **d,
unsigned int *ds);
void exif_data_ref (ExifData *data);
void exif_data_unref (ExifData *data);
void exif_data_free (ExifData *data);
ExifByteOrder exif_data_get_byte_order (ExifData *data);
void exif_data_set_byte_order (ExifData *data, ExifByteOrder order);
ExifMnoteData *exif_data_get_mnote_data (ExifData *d);
void exif_data_fix (ExifData *d);
typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data);
void exif_data_foreach_content (ExifData *data,
ExifDataForeachContentFunc func,
void *user_data);
typedef enum {
EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0,
EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1,
EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2
} ExifDataOption;
const char *exif_data_option_get_name (ExifDataOption o);
const char *exif_data_option_get_description (ExifDataOption o);
void exif_data_set_option (ExifData *d, ExifDataOption o);
void exif_data_unset_option (ExifData *d, ExifDataOption o);
void exif_data_set_data_type (ExifData *d, ExifDataType dt);
ExifDataType exif_data_get_data_type (ExifData *d);
void exif_data_dump (ExifData *data);
void exif_data_log (ExifData *data, ExifLog *log);
#define exif_data_get_entry(d,t) \
(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ? \
exif_content_get_entry(d->ifd[EXIF_IFD_0],t) : \
exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ? \
exif_content_get_entry(d->ifd[EXIF_IFD_1],t) : \
exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ? \
exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) : \
exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ? \
exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) : \
exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ? \
exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __EXIF_DATA_H__ */
EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS
Act as though unknown tags are not present.
Definition: exif-data.h:176
exif_data_log
void exif_data_log(ExifData *data, ExifLog *log)
Set the log message object for all IFDs.
Definition: exif-data.c:1155
exif_data_new
ExifData * exif_data_new(void)
Allocate a new ExifData.
Definition: exif-data.c:92
exif_data_fix
void exif_data_fix(ExifData *d)
Fix the EXIF data to bring it into specification.
Definition: exif-data.c:1264
ExifByteOrder
ExifByteOrder
Which byte order to use.
Definition: exif-byte-order.h:31
_ExifContent
Definition: exif-content.h:40
EXIF_DATA_OPTION_FOLLOW_SPECIFICATION
Fix the EXIF tags to follow the spec.
Definition: exif-data.h:179
exif_data_new_mem
ExifData * exif_data_new_mem(ExifMem *)
Allocate a new ExifData using the given memory allocator.
Definition: exif-data.c:103
exif_data_load_data
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:789
exif_data_get_byte_order
ExifByteOrder exif_data_get_byte_order(ExifData *data)
Return the byte order in use by this EXIF structure.
Definition: exif-data.c:1095
exif_data_unset_option
void exif_data_unset_option(ExifData *d, ExifDataOption o)
Clear the given option on the given ExifData.
Definition: exif-data.c:1227
ExifMem
struct _ExifMem ExifMem
ExifMem define a memory allocator.
Definition: exif-mem.h:57
_ExifData::data
unsigned char * data
Pointer to thumbnail image, or NULL if not available.
Definition: exif-data.h:52
exif_data_foreach_content
void exif_data_foreach_content(ExifData *data, ExifDataForeachContentFunc func, void *user_data)
Execute a function on each IFD in turn.
Definition: exif-data.c:1104
exif-log.h
Log message infrastructure.
exif-mnote-data.h
Handling EXIF MakerNote tags.
_ExifMnoteData
Definition: exif-mnote-data-priv.h:60
exif_data_get_data_type
ExifDataType exif_data_get_data_type(ExifData *d)
Return the data type for the given ExifData.
Definition: exif-data.c:1279
exif_data_new_from_file
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:997
exif-tag.h
Handling EXIF tags.
EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE
Leave the MakerNote alone, which could cause it to be corrupted.
Definition: exif-data.h:182
exif_data_save_data
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:952
exif_data_set_byte_order
void exif_data_set_byte_order(ExifData *data, ExifByteOrder order)
Set the byte order to use for this EXIF data.
Definition: exif-data.c:1139
ExifDataOption
ExifDataOption
Options to configure the behaviour of ExifData.
Definition: exif-data.h:174
exif-mem.h
Define the ExifMem data type and the associated functions.
_ExifData::ifd
ExifContent * ifd[EXIF_IFD_COUNT]
Data for each IFD.
Definition: exif-data.h:49
exif_data_new_from_data
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
exif_data_option_get_description
const char * exif_data_option_get_description(ExifDataOption o)
Return a verbose textual description of the given ExifDataOption.
Definition: exif-data.c:1207
exif_data_set_data_type
void exif_data_set_data_type(ExifData *d, ExifDataType dt)
Set the data type for the given ExifData.
Definition: exif-data.c:1270
exif_data_get_mnote_data
ExifMnoteData * exif_data_get_mnote_data(ExifData *d)
Return the MakerNote data out of the EXIF data.
Definition: exif-data.c:86
_ExifData
Represents the entire EXIF data found in an image.
Definition: exif-data.h:46
exif-content.h
Handling EXIF IFDs.
exif_data_dump
void exif_data_dump(ExifData *data)
Dump all EXIF data to stdout.
Definition: exif-data.c:1068
_ExifData::size
unsigned int size
Number of bytes in thumbnail image at data.
Definition: exif-data.h:55
exif_data_option_get_name
const char * exif_data_option_get_name(ExifDataOption o)
Return a short textual description of the given ExifDataOption.
Definition: exif-data.c:1196
exif-byte-order.h
Defines the ExifByteOrder enum and the associated functions.
ExifLog
struct _ExifLog ExifLog
State maintained by the logging interface.
Definition: exif-log.h:34
exif_data_set_option
void exif_data_set_option(ExifData *d, ExifDataOption o)
Set the given option on the given ExifData.
Definition: exif-data.c:1218