EXIF library (libexif) API
0.6.24
|
Defines the ExifData type and the associated functions. More...
#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>
#include <libexif/exif-content.h>
#include <libexif/exif-mnote-data.h>
#include <libexif/exif-mem.h>
Go to the source code of this file.
Data Structures | |
struct | _ExifData |
Represents the entire EXIF data found in an image. More... | |
Macros | |
#define | exif_data_get_entry(d, t) |
Return an ExifEntry for the given tag if found in any IFD. More... | |
Typedefs | |
typedef struct _ExifData | ExifData |
Represents the entire EXIF data found in an image. | |
typedef struct _ExifDataPrivate | ExifDataPrivate |
typedef void(* | ExifDataForeachContentFunc) (ExifContent *, void *user_data) |
Enumerations | |
enum | ExifDataOption { EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0 , EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1 , EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2 } |
Options to configure the behaviour of ExifData. More... | |
Functions | |
ExifData * | exif_data_new (void) |
Allocate a new ExifData. More... | |
ExifData * | exif_data_new_mem (ExifMem *) |
Allocate a new ExifData using the given memory allocator. More... | |
ExifData * | exif_data_new_from_file (const char *path) |
Allocate a new ExifData and load EXIF data from a JPEG file. More... | |
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. More... | |
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. More... | |
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. More... | |
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) |
Return the byte order in use by this EXIF structure. More... | |
void | exif_data_set_byte_order (ExifData *data, ExifByteOrder order) |
Set the byte order to use for this EXIF data. More... | |
ExifMnoteData * | exif_data_get_mnote_data (ExifData *d) |
Return the MakerNote data out of the EXIF data. More... | |
void | exif_data_fix (ExifData *d) |
Fix the EXIF data to bring it into specification. More... | |
void | exif_data_foreach_content (ExifData *data, ExifDataForeachContentFunc func, void *user_data) |
Execute a function on each IFD in turn. More... | |
const char * | exif_data_option_get_name (ExifDataOption o) |
Return a short textual description of the given ExifDataOption. More... | |
const char * | exif_data_option_get_description (ExifDataOption o) |
Return a verbose textual description of the given ExifDataOption. More... | |
void | exif_data_set_option (ExifData *d, ExifDataOption o) |
Set the given option on the given ExifData. More... | |
void | exif_data_unset_option (ExifData *d, ExifDataOption o) |
Clear the given option on the given ExifData. More... | |
void | exif_data_set_data_type (ExifData *d, ExifDataType dt) |
Set the data type for the given ExifData. More... | |
ExifDataType | exif_data_get_data_type (ExifData *d) |
Return the data type for the given ExifData. More... | |
void | exif_data_dump (ExifData *data) |
Dump all EXIF data to stdout. More... | |
void | exif_data_log (ExifData *data, ExifLog *log) |
Set the log message object for all IFDs. More... | |
Defines the ExifData type and the associated functions.
#define exif_data_get_entry | ( | d, | |
t | |||
) |
Return an ExifEntry for the given tag if found in any IFD.
Each IFD is searched in turn and the first containing a tag with this number is returned.
enum ExifDataOption |
Options to configure the behaviour of ExifData.
void exif_data_dump | ( | ExifData * | data | ) |
Dump all EXIF data to stdout.
This is intended for diagnostic purposes only.
[in] | data | EXIF data |
References _ExifData::data, exif_content_dump(), _ExifData::ifd, and _ExifData::size.
void exif_data_fix | ( | ExifData * | d | ) |
Fix the EXIF data to bring it into specification.
Call exif_content_fix on each IFD to fix existing entries, create any new entries that are mandatory but do not yet exist, and remove any entries that are not allowed.
[in,out] | d | EXIF data |
References exif_data_foreach_content().
void exif_data_foreach_content | ( | ExifData * | data, |
ExifDataForeachContentFunc | func, | ||
void * | user_data | ||
) |
Execute a function on each IFD in turn.
[in] | data | EXIF data over which to iterate |
[in] | func | function to call for each entry |
[in] | user_data | data to pass into func on each call |
Referenced by exif_data_fix(), and exif_data_set_byte_order().
ExifByteOrder exif_data_get_byte_order | ( | ExifData * | data | ) |
Return the byte order in use by this EXIF structure.
[in] | data | EXIF data |
Referenced by exif_entry_get_value(), and exif_entry_initialize().
ExifDataType exif_data_get_data_type | ( | ExifData * | d | ) |
Return the data type for the given ExifData.
[in] | d | EXIF data |
Referenced by exif_content_fix().
ExifMnoteData* exif_data_get_mnote_data | ( | ExifData * | d | ) |
Return the MakerNote data out of the EXIF data.
Only certain MakerNote formats that are recognized by libexif are supported. The pointer references a member of the ExifData structure and must NOT be freed by the caller.
[in] | d | EXIF 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.
If the EXIF data contains a recognized MakerNote, it is loaded and stored as well for later retrieval by exif_data_get_mnote_data. If the EXIF_DATA_OPTION_FOLLOW_SPECIFICATION option has been set on this ExifData, then the tags are automatically fixed after loading (by calling exif_data_fix).
[in,out] | data | EXIF data |
[in] | d | pointer to raw JPEG or EXIF data |
[in] | size | number of bytes of data at d |
Referenced by exif_data_new_from_data(), and exif_loader_get_data().
Set the log message object for all IFDs.
[in] | data | EXIF data |
[in] | log | ExifLog |
Referenced by exif_loader_get_data().
ExifData* exif_data_new | ( | void | ) |
Allocate a new ExifData.
The ExifData contains an empty ExifContent for each IFD and the default set of options, which has EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS and EXIF_DATA_OPTION_FOLLOW_SPECIFICATION set.
References exif_data_new_mem(), exif_mem_new_default(), and exif_mem_unref().
Referenced by 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.
[in] | data | pointer to raw JPEG or EXIF data |
[in] | size | number of bytes of data at data |
References exif_data_load_data(), and exif_data_new().
ExifData* exif_data_new_from_file | ( | const char * | path | ) |
Allocate a new ExifData and load EXIF data from a JPEG file.
Uses an ExifLoader internally to do the loading.
[in] | path | filename including path |
References exif_loader_get_data(), exif_loader_new(), exif_loader_unref(), and exif_loader_write_file().
Allocate a new ExifData using the given memory allocator.
The ExifData contains an empty ExifContent for each IFD and the default set of options, which has EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS and EXIF_DATA_OPTION_FOLLOW_SPECIFICATION set.
Referenced by exif_data_new(), and exif_loader_get_data().
const char* exif_data_option_get_description | ( | ExifDataOption | o | ) |
Return a verbose textual description of the given ExifDataOption.
[in] | o | option |
const char* exif_data_option_get_name | ( | ExifDataOption | o | ) |
Return a short textual description of the given ExifDataOption.
[in] | o | option |
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.
The buffer is allocated by this function and must subsequently be freed by the caller using the matching free function as used by the ExifMem in use by this ExifData.
[in] | data | EXIF data |
[out] | d | pointer to buffer pointer containing raw EXIF data on return |
[out] | ds | pointer to variable to hold the number of bytes of data at d, or set to 0 on error |
References EXIF_BYTE_ORDER_INTEL, exif_set_long(), and exif_set_short().
void exif_data_set_byte_order | ( | ExifData * | data, |
ExifByteOrder | order | ||
) |
Set the byte order to use for this EXIF data.
If any tags already exist (including MakerNote tags) they are are converted to the specified byte order.
[in,out] | data | EXIF data |
[in] | order | byte order |
References exif_data_foreach_content().
void exif_data_set_data_type | ( | ExifData * | d, |
ExifDataType | dt | ||
) |
Set the data type for the given ExifData.
[in] | d | EXIF data |
[in] | dt | data type |
void exif_data_set_option | ( | ExifData * | d, |
ExifDataOption | o | ||
) |
Set the given option on the given ExifData.
[in] | d | EXIF data |
[in] | o | option |
void exif_data_unset_option | ( | ExifData * | d, |
ExifDataOption | o | ||
) |
Clear the given option on the given ExifData.
[in] | d | EXIF data |
[in] | o | option |