| exif-content.h | | exif-content.h | |
|
| /* exif-content.h | | /*! \file exif-content.h | |
| * | | * \brief Handling EXIF IFDs | |
| | | */ | |
| | | /* | |
| * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> | | * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | | * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | | * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | | * version 2 of the License, or (at your option) any later version. | |
| * | | * | |
| * This library is distributed in the hope that it will be useful, | | * This library is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 30 | |
| * Boston, MA 02111-1307, USA. | | * Boston, MA 02111-1307, USA. | |
| */ | | */ | |
| | | | |
| #ifndef __EXIF_CONTENT_H__ | | #ifndef __EXIF_CONTENT_H__ | |
| #define __EXIF_CONTENT_H__ | | #define __EXIF_CONTENT_H__ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
|
| | | /*! Holds all EXIF tags in a single IFD */ | |
| typedef struct _ExifContent ExifContent; | | typedef struct _ExifContent ExifContent; | |
| typedef struct _ExifContentPrivate ExifContentPrivate; | | typedef struct _ExifContentPrivate ExifContentPrivate; | |
| | | | |
| #include <libexif/exif-tag.h> | | #include <libexif/exif-tag.h> | |
| #include <libexif/exif-entry.h> | | #include <libexif/exif-entry.h> | |
| #include <libexif/exif-data.h> | | #include <libexif/exif-data.h> | |
| #include <libexif/exif-log.h> | | #include <libexif/exif-log.h> | |
| #include <libexif/exif-mem.h> | | #include <libexif/exif-mem.h> | |
| | | | |
| struct _ExifContent | | struct _ExifContent | |
| | | | |
| skipping to change at line 55 | | skipping to change at line 58 | |
| ExifContentPrivate *priv; | | ExifContentPrivate *priv; | |
| }; | | }; | |
| | | | |
| /* Lifecycle */ | | /* Lifecycle */ | |
| ExifContent *exif_content_new (void); | | ExifContent *exif_content_new (void); | |
| ExifContent *exif_content_new_mem (ExifMem *); | | ExifContent *exif_content_new_mem (ExifMem *); | |
| void exif_content_ref (ExifContent *content); | | void exif_content_ref (ExifContent *content); | |
| void exif_content_unref (ExifContent *content); | | void exif_content_unref (ExifContent *content); | |
| void exif_content_free (ExifContent *content); | | void exif_content_free (ExifContent *content); | |
| | | | |
|
| void exif_content_add_entry (ExifContent *, ExifEntry *); | | /*! Add an EXIF tag to an IFD. | |
| void exif_content_remove_entry (ExifContent *, ExifEntry *); | | * If this tag already exists in the IFD, this function does nothing. | |
| ExifEntry *exif_content_get_entry (ExifContent *, ExifTag); | | * | |
| void exif_content_fix (ExifContent *); | | * \param[out] c IFD | |
| | | * \param[in] entry EXIF entry to add | |
| | | */ | |
| | | void exif_content_add_entry (ExifContent *c, ExifEntry *entry); | |
| | | | |
| | | /*! Remove an EXIF tag from an IFD. | |
| | | * If this tag does not exist in the IFD, this function does nothing. | |
| | | * | |
| | | * \param[out] c IFD | |
| | | * \param[in] e EXIF entry to remove | |
| | | */ | |
| | | void exif_content_remove_entry (ExifContent *c, ExifEntry *e); | |
| | | | |
| | | /*! Return the #ExifEntry in this IFD corresponding to the given tag. | |
| | | * This is a pointer into a member of the #ExifContent array and must NOT b | |
| | | e | |
| | | * freed by the caller. | |
| | | * | |
| | | * \param[in] content EXIF content for an IFD | |
| | | * \param[in] tag EXIF tag to return | |
| | | * \return #ExifEntry of the tag, or NULL on error | |
| | | */ | |
| | | ExifEntry *exif_content_get_entry (ExifContent *content, ExifTag tag); | |
| | | | |
| | | /*! Fix the IFD to bring it into specification. Call #exif_entry_fix on | |
| | | * each entry in this IFD to fix existing entries, create any new entries | |
| | | * that are mandatory in this IFD but do not yet exist, and remove any | |
| | | * entries that are not allowed in this IFD. | |
| | | * | |
| | | * \param[in,out] c EXIF content for an IFD | |
| | | */ | |
| | | void exif_content_fix (ExifContent *c); | |
| | | | |
| typedef void (* ExifContentForeachEntryFunc) (ExifEntry *, void *user_data)
; | | typedef void (* ExifContentForeachEntryFunc) (ExifEntry *, void *user_data)
; | |
|
| | | | |
| | | /*! Executes function on each EXIF tag in this IFD in turn. | |
| | | * The tags will not necessarily be visited in numerical order. | |
| | | * | |
| | | * \param[in,out] content IFD over which to iterate | |
| | | * \param[in] func function to call for each entry | |
| | | * \param[in] user_data data to pass into func on each call | |
| | | */ | |
| void exif_content_foreach_entry (ExifContent *content, | | void exif_content_foreach_entry (ExifContent *content, | |
| ExifContentForeachEntryFunc func, | | ExifContentForeachEntryFunc func, | |
| void *user_data); | | void *user_data); | |
| | | | |
|
| /* For your convenience */ | | /*! Return the IFD number in which the given #ExifContent is found. | |
| ExifIfd exif_content_get_ifd (ExifContent *); | | * | |
| | | * \param[in] c an #ExifContent* | |
| | | * \return IFD number, or #EXIF_IFD_COUNT on error | |
| | | */ | |
| | | ExifIfd exif_content_get_ifd (ExifContent *c); | |
| | | | |
| | | /*! Return a textual representation of the EXIF data for a tag. | |
| | | * | |
| | | * \param[in] c #ExifContent* for an IFD | |
| | | * \param[in] t #ExifTag to return | |
| | | * \param[out] v char* buffer in which to store value | |
| | | * \param[in] m unsigned int length of the buffer v | |
| | | * \return the v pointer, or NULL on error | |
| | | */ | |
| #define exif_content_get_value(c,t,v,m)
\ | | #define exif_content_get_value(c,t,v,m)
\ | |
| (exif_content_get_entry (c,t) ? \ | | (exif_content_get_entry (c,t) ? \ | |
| exif_entry_get_value (exif_content_get_entry (c,t),v,m) : NULL) | | exif_entry_get_value (exif_content_get_entry (c,t),v,m) : NULL) | |
| | | | |
|
| | | /*! Dump contents of the IFD to stdout. | |
| | | * This is intended for diagnostic purposes only. | |
| | | * | |
| | | * \param[in] content IFD data | |
| | | * \param[in] indent how many levels deep to indent the data | |
| | | */ | |
| void exif_content_dump (ExifContent *content, unsigned int indent); | | void exif_content_dump (ExifContent *content, unsigned int indent); | |
|
| | | | |
| | | /*! Set the log message object for this IFD. | |
| | | * | |
| | | * \param[in] content IFD | |
| | | * \param[in] log #ExifLog* | |
| | | */ | |
| void exif_content_log (ExifContent *content, ExifLog *log); | | void exif_content_log (ExifContent *content, ExifLog *log); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #endif /* __EXIF_CONTENT_H__ */ | | #endif /* __EXIF_CONTENT_H__ */ | |
| | | | |
End of changes. 7 change blocks. |
| 8 lines changed or deleted | | 75 lines changed or added | |
|
| exif-data.h | | exif-data.h | |
| /*! \file exif-data.h | | /*! \file exif-data.h | |
| * \brief Defines the ExifData type and the associated functions. | | * \brief Defines the ExifData type and the associated functions. | |
|
| * | | */ | |
| | | /* | |
| * \author Lutz Mueller <lutz@users.sourceforge.net> | | * \author Lutz Mueller <lutz@users.sourceforge.net> | |
| * \date 2001-2005 | | * \date 2001-2005 | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | | * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | | * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | | * version 2 of the License, or (at your option) any later version. | |
| * | | * | |
| * This library is distributed in the hope that it will be useful, | | * This library is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| | | | |
| skipping to change at line 36 | | skipping to change at line 37 | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #include <libexif/exif-byte-order.h> | | #include <libexif/exif-byte-order.h> | |
| #include <libexif/exif-data-type.h> | | #include <libexif/exif-data-type.h> | |
| #include <libexif/exif-ifd.h> | | #include <libexif/exif-ifd.h> | |
| #include <libexif/exif-log.h> | | #include <libexif/exif-log.h> | |
| #include <libexif/exif-tag.h> | | #include <libexif/exif-tag.h> | |
| | | | |
|
| | | /*! Represents the entire EXIF data found in an image */ | |
| typedef struct _ExifData ExifData; | | typedef struct _ExifData ExifData; | |
| typedef struct _ExifDataPrivate ExifDataPrivate; | | typedef struct _ExifDataPrivate ExifDataPrivate; | |
| | | | |
| #include <libexif/exif-content.h> | | #include <libexif/exif-content.h> | |
| #include <libexif/exif-mnote-data.h> | | #include <libexif/exif-mnote-data.h> | |
| #include <libexif/exif-mem.h> | | #include <libexif/exif-mem.h> | |
| | | | |
|
| | | /*! Represents the entire EXIF data found in an image */ | |
| struct _ExifData | | struct _ExifData | |
| { | | { | |
|
| | | /*! Data for each IFD */ | |
| ExifContent *ifd[EXIF_IFD_COUNT]; | | ExifContent *ifd[EXIF_IFD_COUNT]; | |
| | | | |
|
| | | /*! Pointer to thumbnail image, or NULL if not available */ | |
| unsigned char *data; | | unsigned char *data; | |
|
| | | | |
| | | /*! Number of bytes in thumbnail image at \c data */ | |
| unsigned int size; | | unsigned int size; | |
| | | | |
| ExifDataPrivate *priv; | | ExifDataPrivate *priv; | |
| }; | | }; | |
| | | | |
|
| | | /*! 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. | |
| | | * | |
| | | * \return allocated #ExifData, or NULL on error | |
| | | */ | |
| ExifData *exif_data_new (void); | | ExifData *exif_data_new (void); | |
|
| | | | |
| | | /*! Allocate a new #ExifData using the given memory allocator. | |
| | | * The #ExifData contains an empty #ExifContent for each IFD and the defaul | |
| | | t | |
| | | * set of options, which has #EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS and | |
| | | * #EXIF_DATA_OPTION_FOLLOW_SPECIFICATION set. | |
| | | * | |
| | | * \return allocated #ExifData, or NULL on error | |
| | | */ | |
| ExifData *exif_data_new_mem (ExifMem *); | | ExifData *exif_data_new_mem (ExifMem *); | |
| | | | |
|
| /*! \brief load exif data from file | | /*! Allocate a new #ExifData and load EXIF data from a JPEG file. | |
| * \param[in] path filename including path | | * Uses an #ExifLoader internally to do the loading. | |
| | | * | |
| | | * \param[in] path filename including path | |
| | | * \return allocated #ExifData, or NULL on error | |
| */ | | */ | |
| ExifData *exif_data_new_from_file (const char *path); | | ExifData *exif_data_new_from_file (const char *path); | |
|
| | | | |
| | | /*! Allocate a new #ExifData and load EXIF data from a memory buffer. | |
| | | * | |
| | | * \param[in] data pointer to raw JPEG or EXIF data | |
| | | * \param[in] size number of bytes of data at data | |
| | | * \return allocated #ExifData, or NULL on error | |
| | | */ | |
| ExifData *exif_data_new_from_data (const unsigned char *data, | | ExifData *exif_data_new_from_data (const unsigned char *data, | |
| unsigned int size); | | unsigned int size); | |
| | | | |
|
| | | /*! Load the #ExifData structure from the raw JPEG or EXIF data in the give | |
| | | n | |
| | | * 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_da | |
| | | ta. | |
| | | * If the EXIF_DATA_OPTION_FOLLOW_SPECIFICATION has been set on this #ExifD | |
| | | ata, | |
| | | * then the tags are fixed after loading. | |
| | | * | |
| | | * \param[in,out] data EXIF data | |
| | | * \param[in] d pointer to raw JPEG or EXIF data | |
| | | * \param[in] size number of bytes of data at d | |
| | | */ | |
| void exif_data_load_data (ExifData *data, const unsigned char *d, | | void exif_data_load_data (ExifData *data, const unsigned char *d, | |
| unsigned int size); | | unsigned int size); | |
|
| | | | |
| | | /*! Store raw EXIF data representing the #ExifData structure into a memory | |
| | | * buffer. The buffer is allocated by this function and must subsequently b | |
| | | e | |
| | | * freed by the caller. | |
| | | * | |
| | | * \param[in] data EXIF data | |
| | | * \param[out] d pointer to buffer pointer containing raw EXIF data on retu | |
| | | rn | |
| | | * \param[out] ds pointer to variable to hold the number of bytes of | |
| | | * data at d, or set to 0 on error | |
| | | */ | |
| void exif_data_save_data (ExifData *data, unsigned char **d, | | void exif_data_save_data (ExifData *data, unsigned char **d, | |
|
| unsigned int *size); | | unsigned int *ds); | |
| | | | |
| void exif_data_ref (ExifData *data); | | void exif_data_ref (ExifData *data); | |
| void exif_data_unref (ExifData *data); | | void exif_data_unref (ExifData *data); | |
| void exif_data_free (ExifData *data); | | void exif_data_free (ExifData *data); | |
| | | | |
|
| | | /*! Return the byte order in use by this EXIF structure. | |
| | | * | |
| | | * \param[in] data EXIF data | |
| | | * \return byte order | |
| | | */ | |
| ExifByteOrder exif_data_get_byte_order (ExifData *data); | | ExifByteOrder exif_data_get_byte_order (ExifData *data); | |
|
| | | | |
| | | /*! 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. | |
| | | * | |
| | | * \param[in,out] data EXIF data | |
| | | * \param[in] order byte order | |
| | | */ | |
| void exif_data_set_byte_order (ExifData *data, ExifByteOrder orde
r); | | void exif_data_set_byte_order (ExifData *data, ExifByteOrder orde
r); | |
| | | | |
|
| ExifMnoteData *exif_data_get_mnote_data (ExifData *); | | /*! Return the MakerNote data out of the EXIF data. Only certain | |
| void exif_data_fix (ExifData *); | | * 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. | |
| | | * | |
| | | * \param[in] d EXIF data | |
| | | * \return MakerNote data, or NULL if not found or not supported | |
| | | */ | |
| | | ExifMnoteData *exif_data_get_mnote_data (ExifData *d); | |
| | | | |
| | | /*! Fix the EXIF data to bring it into specification. Call #exif_content_fi | |
| | | x | |
| | | * 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. | |
| | | * | |
| | | * \param[in,out] d EXIF data | |
| | | */ | |
| | | void exif_data_fix (ExifData *d); | |
| | | | |
| typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data
); | | typedef void (* ExifDataForeachContentFunc) (ExifContent *, void *user_data
); | |
|
| | | | |
| | | /*! Execute a function on each IFD in turn. | |
| | | * | |
| | | * \param[in] data EXIF data over which to iterate | |
| | | * \param[in] func function to call for each entry | |
| | | * \param[in] user_data data to pass into func on each call | |
| | | */ | |
| void exif_data_foreach_content (ExifData *data, | | void exif_data_foreach_content (ExifData *data, | |
| ExifDataForeachContentFunc func, | | ExifDataForeachContentFunc func, | |
| void *user_data); | | void *user_data); | |
| | | | |
|
| | | /*! Options to configure the behaviour of #ExifData */ | |
| typedef enum { | | typedef enum { | |
|
| | | /*! Act as though unknown tags are not present */ | |
| EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0, | | EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS = 1 << 0, | |
|
| | | | |
| | | /*! Fix the EXIF tags to follow the spec */ | |
| EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1, | | EXIF_DATA_OPTION_FOLLOW_SPECIFICATION = 1 << 1, | |
|
| | | | |
| | | /*! Leave the MakerNote alone, which could cause it to be corrupted | |
| | | */ | |
| EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2 | | EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE = 1 << 2 | |
| } ExifDataOption; | | } ExifDataOption; | |
| | | | |
|
| const char *exif_data_option_get_name (ExifDataOption); | | /*! Return a short textual description of the given #ExifDataOption. | |
| const char *exif_data_option_get_description (ExifDataOption); | | * | |
| void exif_data_set_option (ExifData *, ExifDataOption); | | * \param[in] o option | |
| void exif_data_unset_option (ExifData *, ExifDataOption); | | * \return localized textual description of the option | |
| | | */ | |
| | | const char *exif_data_option_get_name (ExifDataOption o); | |
| | | | |
| | | /*! Return a verbose textual description of the given #ExifDataOption. | |
| | | * | |
| | | * \param[in] o option | |
| | | * \return verbose localized textual description of the option | |
| | | */ | |
| | | const char *exif_data_option_get_description (ExifDataOption o); | |
| | | | |
|
| void exif_data_set_data_type (ExifData *, ExifDataType); | | /*! Set the given option on the given #ExifData. | |
| ExifDataType exif_data_get_data_type (ExifData *); | | * | |
| | | * \param[in] d EXIF data | |
| | | * \param[in] o option | |
| | | */ | |
| | | void exif_data_set_option (ExifData *d, ExifDataOption o | |
| | | ); | |
| | | | |
| | | /*! Clear the given option on the given #ExifData. | |
| | | * | |
| | | * \param[in] d EXIF data | |
| | | * \param[in] o option | |
| | | */ | |
| | | void exif_data_unset_option (ExifData *d, ExifDataOption o | |
| | | ); | |
| | | | |
|
| /* For debugging purposes and error reporting */ | | /*! Set the data type for the given #ExifData. | |
| | | * | |
| | | * \param[in] d EXIF data | |
| | | * \param[in] dt data type | |
| | | */ | |
| | | void exif_data_set_data_type (ExifData *d, ExifDataType dt); | |
| | | | |
| | | /*! Return the data type for the given #ExifData. | |
| | | * | |
| | | * \param[in] d EXIF data | |
| | | * \return data type, or #EXIF_DATA_TYPE_UNKNOWN on error | |
| | | */ | |
| | | ExifDataType exif_data_get_data_type (ExifData *d); | |
| | | | |
| | | /*! Dump all EXIF data to stdout. | |
| | | * This is intended for diagnostic purposes only. | |
| | | * | |
| | | * \param[in] data EXIF data | |
| | | */ | |
| void exif_data_dump (ExifData *data); | | void exif_data_dump (ExifData *data); | |
|
| | | | |
| | | /*! Set the log message object for all IFDs. | |
| | | * | |
| | | * \param[in] data EXIF data | |
| | | * \param[in] log #ExifLog | |
| | | */ | |
| void exif_data_log (ExifData *data, ExifLog *log); | | void exif_data_log (ExifData *data, ExifLog *log); | |
| | | | |
|
| /** convenience macro. */ | | /*! 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. | |
| | | * | |
| | | * \param[in] d #ExifData | |
| | | * \param[in] t #ExifTag | |
| | | * \return #ExifEntry* if found, else NULL if not found | |
| | | */ | |
| #define exif_data_get_entry(d,t) \ | | #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_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_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_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_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) ? \ | |
| | | | |
End of changes. 26 change blocks. |
| 14 lines changed or deleted | | 170 lines changed or added | |
|
| exif-entry.h | | exif-entry.h | |
| /*! \file exif-entry.h | | /*! \file exif-entry.h | |
| * \brief Handling EXIF entries | | * \brief Handling EXIF entries | |
|
| * | | */ | |
| | | /* | |
| * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> | | * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | | * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | | * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | | * version 2 of the License, or (at your option) any later version. | |
| * | | * | |
| * This library is distributed in the hope that it will be useful, | | * This library is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 30 | |
| * Boston, MA 02111-1307, USA. | | * Boston, MA 02111-1307, USA. | |
| */ | | */ | |
| | | | |
| #ifndef __EXIF_ENTRY_H__ | | #ifndef __EXIF_ENTRY_H__ | |
| #define __EXIF_ENTRY_H__ | | #define __EXIF_ENTRY_H__ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
|
| | | /*! Data found in one EXIF tag. | |
| | | * The #exif_entry_get_value function can provide access to the | |
| | | * formatted contents, or the struct members can be used directly to | |
| | | * access the raw contents. | |
| | | */ | |
| typedef struct _ExifEntry ExifEntry; | | typedef struct _ExifEntry ExifEntry; | |
| typedef struct _ExifEntryPrivate ExifEntryPrivate; | | typedef struct _ExifEntryPrivate ExifEntryPrivate; | |
| | | | |
| #include <libexif/exif-content.h> | | #include <libexif/exif-content.h> | |
| #include <libexif/exif-format.h> | | #include <libexif/exif-format.h> | |
| #include <libexif/exif-mem.h> | | #include <libexif/exif-mem.h> | |
| | | | |
|
| /*! */ | | /*! Data found in one EXIF tag */ | |
| struct _ExifEntry { | | struct _ExifEntry { | |
|
| | | /*! EXIF tag for this entry */ | |
| ExifTag tag; | | ExifTag tag; | |
|
| | | | |
| | | /*! Type of data in this entry */ | |
| ExifFormat format; | | ExifFormat format; | |
|
| | | | |
| | | /*! Number of elements in the array, if this is an array entry. | |
| | | * Contains 1 for non-array data types. */ | |
| unsigned long components; | | unsigned long components; | |
| | | | |
|
| | | /*! Pointer to the raw EXIF data for this entry. It is allocated | |
| | | * by #exif_entry_initialize and is NULL beforehand. Data contained | |
| | | * here may be manipulated using the functions in exif-utils.h */ | |
| unsigned char *data; | | unsigned char *data; | |
|
| | | | |
| | | /*! Number of bytes in the buffer at \c data. This must be no less | |
| | | * than exif_format_get_size(format)*components */ | |
| unsigned int size; | | unsigned int size; | |
| | | | |
|
| /* Content containing this entry */ | | /*! #ExifContent containing this entry. | |
| | | * \see #exif_entry_get_ifd */ | |
| ExifContent *parent; | | ExifContent *parent; | |
| | | | |
|
| | | /*! Internal data to be used by libexif itself */ | |
| ExifEntryPrivate *priv; | | ExifEntryPrivate *priv; | |
| }; | | }; | |
| | | | |
| /* Lifecycle */ | | /* Lifecycle */ | |
| | | | |
|
| /*! Reserve memory for and initialize new #ExifEntry* */ | | /*! Reserve memory for and initialize a new #ExifEntry. | |
| | | * No memory is allocated for the \c data element of the returned #ExifEntr | |
| | | y. | |
| | | * | |
| | | * \return new allocated #ExifEntry, or NULL on error | |
| | | * | |
| | | * \see exif_entry_new_mem, exif_entry_unref | |
| | | */ | |
| ExifEntry *exif_entry_new (void); | | ExifEntry *exif_entry_new (void); | |
| | | | |
|
| | | /*! Reserve memory for and initialize new #ExifEntry using the specified | |
| | | * memory allocator. | |
| | | * No memory is allocated for the \c data element of the returned #ExifEntr | |
| | | y. | |
| | | * | |
| | | * \return new allocated #ExifEntry, or NULL on error | |
| | | * | |
| | | * \see exif_entry_new, exif_entry_unref | |
| | | */ | |
| ExifEntry *exif_entry_new_mem (ExifMem *); | | ExifEntry *exif_entry_new_mem (ExifMem *); | |
| | | | |
|
| /*! Increase reference counter for #ExifEntry* */ | | /*! Increase reference counter for #ExifEntry. | |
| | | * | |
| | | * \param[in] entry #ExifEntry | |
| | | * | |
| | | * \see exif_entry_unref | |
| | | */ | |
| void exif_entry_ref (ExifEntry *entry); | | void exif_entry_ref (ExifEntry *entry); | |
| | | | |
|
| /*! Decrease reference counter for #ExifEntry* */ | | /*! Decrease reference counter for #ExifEntry. | |
| | | * When the reference count drops to zero, free the entry. | |
| | | * | |
| | | * \param[in] entry #ExifEntry | |
| | | */ | |
| void exif_entry_unref (ExifEntry *entry); | | void exif_entry_unref (ExifEntry *entry); | |
| | | | |
|
| /*! Actually free the #ExifEntry* | | /*! Actually free the #ExifEntry. | |
| | | * | |
| | | * \deprecated Should not be called directly. Use #exif_entry_ref and | |
| | | * #exif_entry_unref instead. | |
| * | | * | |
|
| * \deprecated Should not be called directly. Use exif_entry_ref() and | | * \param[in] entry EXIF entry | |
| * exif_entry_unref() instead. | | | |
| */ | | */ | |
| void exif_entry_free (ExifEntry *entry); | | void exif_entry_free (ExifEntry *entry); | |
| | | | |
|
| void exif_entry_initialize (ExifEntry *entry, ExifTag tag); | | /*! Initialize an empty #ExifEntry with default data in the correct format | |
| | | * for the given tag. If the entry is already initialized, this function | |
| | | * does nothing. | |
| | | * This call allocates memory for the \c data element of the given #ExifEnt | |
| | | ry. | |
| | | * That memory is freed at the same time as the #ExifEntry. | |
| | | * | |
| | | * \param[out] e entry to initialize | |
| | | * \param[in] tag tag number to initialize as | |
| | | */ | |
| | | void exif_entry_initialize (ExifEntry *e, ExifTag tag); | |
| | | | |
| | | /*! Fix the type or format of the given EXIF entry to bring it into spec. | |
| | | * If the data for this EXIF tag is in of the wrong type or is in an invali | |
| | | d | |
| | | * format according to the EXIF specification, then it is converted to make | |
| | | it | |
| | | * valid. This may involve, for example, converting an EXIF_FORMAT_LONG int | |
| | | o a | |
| | | * EXIF_FORMAT_SHORT. If the tag is unknown, its value is untouched. | |
| | | * | |
| | | * \note Unfortunately, some conversions are to a type with a more restrict | |
| | | ed | |
| | | * range, which could have the side effect that the converted data becomes | |
| | | * invalid. This is unlikely as the range of each tag in the standard is | |
| | | * designed to encompass all likely data. | |
| | | * | |
| | | * \param[in,out] entry EXIF entry | |
| | | */ | |
| void exif_entry_fix (ExifEntry *entry); | | void exif_entry_fix (ExifEntry *entry); | |
| | | | |
| /* For your convenience */ | | /* For your convenience */ | |
| | | | |
|
| /*! Return the value of the EXIF entry | | /*! Return a localized textual representation of the value of the EXIF entr | |
| * | | y. | |
| * CAUTION: The character set of the returned string is not defined. | | * This is meant for display to the user. The format of each tag is subject | |
| * It may be UTF-8, latin1, the native encoding of the | | * to change between locales and in newer versions of libexif. Users who | |
| * computer, or the native encoding of the camera. | | * require the tag data in an unambiguous form should access the data membe | |
| | | rs | |
| | | * of the #ExifEntry structure directly. | |
| | | * | |
| | | * \warning The character set of the returned string may be in | |
| | | * the encoding of the current locale or the native encoding | |
| | | * of the camera. | |
| | | * \bug The EXIF_TAG_XP_* tags are currently always returned in UTF-8, | |
| | | * regardless of locale, and code points above U+FFFF are not | |
| | | * supported. | |
| | | * | |
| | | * \param[in] entry EXIF entry | |
| | | * \param[out] val buffer in which to store value | |
| | | * \param[in] maxlen length of the buffer val | |
| | | * \return val pointer | |
| */ | | */ | |
| const char *exif_entry_get_value (ExifEntry *entry, char *val, | | const char *exif_entry_get_value (ExifEntry *entry, char *val, | |
| unsigned int maxlen); | | unsigned int maxlen); | |
| | | | |
|
| /*! Dump text representation of #ExifEntry to stdout */ | | /*! Dump text representation of #ExifEntry to stdout. | |
| | | * This is intended for diagnostic purposes only. | |
| | | * | |
| | | * \param[in] entry EXIF tag data | |
| | | * \param[in] indent how many levels deep to indent the data | |
| | | */ | |
| void exif_entry_dump (ExifEntry *entry, unsigned int indent); | | void exif_entry_dump (ExifEntry *entry, unsigned int indent); | |
| | | | |
|
| | | /*! Return the IFD number of the given #ExifEntry | |
| | | * | |
| | | * \param[in] e an #ExifEntry* | |
| | | * \return #ExifIfd, or #EXIF_IFD_COUNT on error | |
| | | */ | |
| #define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_I
FD_COUNT) | | #define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_I
FD_COUNT) | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #endif /* __EXIF_ENTRY_H__ */ | | #endif /* __EXIF_ENTRY_H__ */ | |
| | | | |
End of changes. 20 change blocks. |
| 16 lines changed or deleted | | 115 lines changed or added | |
|
| exif-loader.h | | exif-loader.h | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| #define __EXIF_LOADER_H__ | | #define __EXIF_LOADER_H__ | |
| | | | |
| #include <libexif/exif-data.h> | | #include <libexif/exif-data.h> | |
| #include <libexif/exif-log.h> | | #include <libexif/exif-log.h> | |
| #include <libexif/exif-mem.h> | | #include <libexif/exif-mem.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
|
| | | /*! Data used by the loader interface */ | |
| typedef struct _ExifLoader ExifLoader; | | typedef struct _ExifLoader ExifLoader; | |
| | | | |
|
| /*! Allocate a new ExifLoader | | /*! Allocate a new #ExifLoader. | |
| * \returns the allocated ExifLoader | | * | |
| | | * \return allocated ExifLoader | |
| */ | | */ | |
| ExifLoader *exif_loader_new (void); | | ExifLoader *exif_loader_new (void); | |
|
| /*! Allocate a new ExifLoader using an ExifMem | | | |
| | | /*! Allocate a new #ExifLoader using the specified memory allocator. | |
| | | * | |
| * \param[in] mem the ExifMem | | * \param[in] mem the ExifMem | |
|
| * \returns the allocated ExifLoader | | * \return allocated ExifLoader | |
| */ | | */ | |
| ExifLoader *exif_loader_new_mem (ExifMem *mem); | | ExifLoader *exif_loader_new_mem (ExifMem *mem); | |
|
| /*! Increase the refcount of the ExifLoader | | | |
| | | /*! Increase the refcount of the #ExifLoader. | |
| | | * | |
| * \param[in] loader the ExifLoader to increase the refcount of. | | * \param[in] loader the ExifLoader to increase the refcount of. | |
| */ | | */ | |
| void exif_loader_ref (ExifLoader *loader); | | void exif_loader_ref (ExifLoader *loader); | |
|
| /*! Decrease the refcount of the ExifLoader | | | |
| * \param[in] loader the ExifLoader to decrease the refcount of. | | /*! Decrease the refcount of the #ExifLoader. | |
| * If the refcount reaches 0, the ExifLoader is freeed. | | * If the refcount reaches 0, the loader is freed. | |
| | | * | |
| | | * \param[in] loader ExifLoader for which to decrease the refcount | |
| */ | | */ | |
| void exif_loader_unref (ExifLoader *loader); | | void exif_loader_unref (ExifLoader *loader); | |
| | | | |
|
| /*! Write a file to the ExifLoader | | /*! Load a file into the given #ExifLoader from the filesystem. | |
| * \param[in] loader the loader | | * The relevant data is copied in raw form into the #ExifLoader. | |
| * \param[in] fname the path to the file to read | | * | |
| | | * \param[in] loader loader to write to | |
| | | * \param[in] fname path to the file to read | |
| */ | | */ | |
| void exif_loader_write_file (ExifLoader *loader, const char *fname); | | void exif_loader_write_file (ExifLoader *loader, const char *fname); | |
| | | | |
|
| /*! Write a buffer to the ExifLoader | | /*! Load a buffer into the #ExifLoader from a memory buffer. | |
| * \param[in] loader the loader to write too | | * The relevant data is copied in raw form into the #ExifLoader. | |
| * \param[in] buf the buffer to read from | | * | |
| * \param[in] sz the size of the buffer | | * \param[in] loader loader to write to | |
| * \returns 1 while EXIF data is read (or while there is still hope that th | | * \param[in] buf buffer to read from | |
| ere will be EXIF data later on), 0 otherwise. | | * \param[in] sz size of the buffer | |
| | | * \return 1 while EXIF data is read (or while there is still hope that | |
| | | * there will be EXIF data later on), 0 otherwise. | |
| */ | | */ | |
| unsigned char exif_loader_write (ExifLoader *loader, unsigned char *buf, un
signed int sz); | | unsigned char exif_loader_write (ExifLoader *loader, unsigned char *buf, un
signed int sz); | |
| | | | |
|
| /*! Reset the ExifLoader | | /*! Free any data previously loaded and reset the #ExifLoader to its | |
| | | * newly-initialized state. | |
| | | * | |
| * \param[in] loader the loader | | * \param[in] loader the loader | |
| */ | | */ | |
| void exif_loader_reset (ExifLoader *loader); | | void exif_loader_reset (ExifLoader *loader); | |
|
| /*! Get an ExifData out of an ExifLoader | | | |
| | | /*! Create an #ExifData from the data in the loader. The loader must | |
| | | * already contain data from a previous call to #exif_loader_write_file | |
| | | * or #exif_loader_write. | |
| | | * | |
| * \param[in] loader the loader | | * \param[in] loader the loader | |
|
| * \returns and allocated ExifData | | * \return allocated ExifData | |
| */ | | */ | |
| ExifData *exif_loader_get_data (ExifLoader *loader); | | ExifData *exif_loader_get_data (ExifLoader *loader); | |
| | | | |
|
| void exif_loader_log (ExifLoader *, ExifLog *); | | /*! Return the data read by the loader. The returned pointer is only | |
| | | * guaranteed to be valid until the next call to a function modifying | |
| | | * this #ExifLoader. Either or both of buf and buf_size may be NULL on | |
| | | * entry, in which case that value is not returned. | |
| | | * | |
| | | * \param[in] loader the loader | |
| | | * \param[out] buf read-only pointer to the data read by the loader, or NUL | |
| | | L | |
| | | * in case of error | |
| | | * \param[out] buf_size size of the data at buf, or 0 in case of error | |
| | | */ | |
| | | void exif_loader_get_buf (ExifLoader *loader, const unsigned char **buf, | |
| | | unsigned int *buf_size); | |
| | | | |
| | | /*! Set the log message object used by this #ExifLoader. | |
| | | * \param[in] loader the loader | |
| | | * \param[in] log #ExifLog | |
| | | */ | |
| | | void exif_loader_log (ExifLoader *loader, ExifLog *log); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #endif /* __EXIF_LOADER_H__ */ | | #endif /* __EXIF_LOADER_H__ */ | |
| | | | |
End of changes. 12 change blocks. |
| 21 lines changed or deleted | | 57 lines changed or added | |
|
| exif-log.h | | exif-log.h | |
| /*! \file exif-log.h | | /*! \file exif-log.h | |
|
| * \brief log message infrastructure | | * \brief Log message infrastructure | |
| * | | */ | |
| | | /* | |
| * Copyright (c) 2004 Lutz Mueller <lutz@users.sourceforge.net> | | * Copyright (c) 2004 Lutz Mueller <lutz@users.sourceforge.net> | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | | * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | | * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | | * version 2 of the License, or (at your option) any later version. | |
| * | | * | |
| * This library is distributed in the hope that it will be useful, | | * This library is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 33 | |
| #ifndef __EXIF_LOG_H__ | | #ifndef __EXIF_LOG_H__ | |
| #define __EXIF_LOG_H__ | | #define __EXIF_LOG_H__ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #include <libexif/exif-mem.h> | | #include <libexif/exif-mem.h> | |
| #include <stdarg.h> | | #include <stdarg.h> | |
| | | | |
|
| | | /*! State maintained by the logging interface */ | |
| typedef struct _ExifLog ExifLog; | | typedef struct _ExifLog ExifLog; | |
| | | | |
|
| | | /*! Create a new logging instance. | |
| | | * \see exif_log_free | |
| | | * | |
| | | * \return new instance of #ExifLog | |
| | | */ | |
| ExifLog *exif_log_new (void); | | ExifLog *exif_log_new (void); | |
| ExifLog *exif_log_new_mem (ExifMem *); | | ExifLog *exif_log_new_mem (ExifMem *); | |
| void exif_log_ref (ExifLog *log); | | void exif_log_ref (ExifLog *log); | |
| void exif_log_unref (ExifLog *log); | | void exif_log_unref (ExifLog *log); | |
|
| | | | |
| | | /*! Delete instance of #ExifLog. | |
| | | * \see exif_log_new | |
| | | * | |
| | | * \param[in] log #ExifLog | |
| | | * \return new instance of #ExifLog | |
| | | */ | |
| void exif_log_free (ExifLog *log); | | void exif_log_free (ExifLog *log); | |
| | | | |
| typedef enum { | | typedef enum { | |
| EXIF_LOG_CODE_NONE, | | EXIF_LOG_CODE_NONE, | |
| EXIF_LOG_CODE_DEBUG, | | EXIF_LOG_CODE_DEBUG, | |
| EXIF_LOG_CODE_NO_MEMORY, | | EXIF_LOG_CODE_NO_MEMORY, | |
| EXIF_LOG_CODE_CORRUPT_DATA | | EXIF_LOG_CODE_CORRUPT_DATA | |
| } ExifLogCode; | | } ExifLogCode; | |
|
| const char *exif_log_code_get_title (ExifLogCode); /* Title for dialog | | | |
| */ | | | |
| const char *exif_log_code_get_message (ExifLogCode); /* Message for dialog | | | |
| */ | | | |
| | | | |
|
| /** Log callback function prototype. | | /*! Return a textual description of the given class of error log. | |
| | | * | |
| | | * \param[in] code logging message class | |
| | | * \return textual description of the log class | |
| | | */ | |
| | | const char *exif_log_code_get_title (ExifLogCode code); | |
| | | | |
| | | /*! Return a verbose description of the given class of error log. | |
| | | * | |
| | | * \param[in] code logging message class | |
| | | * \return verbose description of the log class | |
| | | */ | |
| | | const char *exif_log_code_get_message (ExifLogCode code); | |
| | | | |
| | | /*! Log callback function prototype. | |
| */ | | */ | |
| typedef void (* ExifLogFunc) (ExifLog *log, ExifLogCode, const char *domain
, | | typedef void (* ExifLogFunc) (ExifLog *log, ExifLogCode, const char *domain
, | |
| const char *format, va_list args, void *data); | | const char *format, va_list args, void *data); | |
| | | | |
|
| /** Register log callback function. | | /*! Register log callback function. | |
| | | * Calls to the log callback function are purely for diagnostic purposes. | |
| | | * | |
| | | * \param[in] log logging state variable | |
| | | * \param[in] func callback function to set | |
| | | * \param[in] data data to pass into callback function | |
| */ | | */ | |
| void exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data); | | void exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data); | |
| | | | |
| #ifndef NO_VERBOSE_TAG_STRINGS | | #ifndef NO_VERBOSE_TAG_STRINGS | |
| void exif_log (ExifLog *log, ExifLogCode, const char *domain, | | void exif_log (ExifLog *log, ExifLogCode, const char *domain, | |
| const char *format, ...) | | const char *format, ...) | |
| #ifdef __GNUC__ | | #ifdef __GNUC__ | |
| __attribute__((__format__(printf,4,5))) | | __attribute__((__format__(printf,4,5))) | |
| #endif | | #endif | |
| ; | | ; | |
| | | | |
End of changes. 7 change blocks. |
| 8 lines changed or deleted | | 37 lines changed or added | |
|
| exif-mem.h | | exif-mem.h | |
| /*! \file exif-mem.h | | /*! \file exif-mem.h | |
| * \brief Define the ExifMem data type and the associated functions. | | * \brief Define the ExifMem data type and the associated functions. | |
| * ExifMem defines the memory management functions used by the ExifLoader. | | * ExifMem defines the memory management functions used by the ExifLoader. | |
| */ | | */ | |
|
| | | | |
| /* exif-mem.h | | /* exif-mem.h | |
| * | | * | |
| * Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net> | | * Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net> | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | | * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | | * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | | * version 2 of the License, or (at your option) any later version. | |
| * | | * | |
| * This library is distributed in the hope that it will be useful, | | * This library is distributed in the hope that it will be useful, | |
| | | | |
| skipping to change at line 36 | | skipping to change at line 35 | |
| #ifndef __EXIF_MEM_H__ | | #ifndef __EXIF_MEM_H__ | |
| #define __EXIF_MEM_H__ | | #define __EXIF_MEM_H__ | |
| | | | |
| #include <libexif/exif-utils.h> | | #include <libexif/exif-utils.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| /*! Should work like calloc() | | /*! Should work like calloc() | |
|
| | | * | |
| * \param[in] s the size of the block to allocate. | | * \param[in] s the size of the block to allocate. | |
|
| * \returns the allocated memory and initialized. | | * \return the allocated memory and initialized. | |
| */ | | */ | |
| typedef void * (* ExifMemAllocFunc) (ExifLong s); | | typedef void * (* ExifMemAllocFunc) (ExifLong s); | |
| | | | |
| /*! Should work like realloc() | | /*! Should work like realloc() | |
|
| | | * | |
| * \param[in] p the pointer to reallocate | | * \param[in] p the pointer to reallocate | |
| * \param[in] s the size of the reallocated block | | * \param[in] s the size of the reallocated block | |
|
| * \returns allocated memory | | * \return allocated memory | |
| */ | | */ | |
| typedef void * (* ExifMemReallocFunc) (void *p, ExifLong s); | | typedef void * (* ExifMemReallocFunc) (void *p, ExifLong s); | |
|
| | | | |
| /*! Free method for ExifMem | | /*! Free method for ExifMem | |
|
| | | * | |
| * \param[in] p the pointer to free | | * \param[in] p the pointer to free | |
|
| * \returns the freed pointer | | * \return the freed pointer | |
| */ | | */ | |
| typedef void (* ExifMemFreeFunc) (void *p); | | typedef void (* ExifMemFreeFunc) (void *p); | |
| | | | |
| /*! ExifMem define a memory allocator */ | | /*! ExifMem define a memory allocator */ | |
| typedef struct _ExifMem ExifMem; | | typedef struct _ExifMem ExifMem; | |
| | | | |
| /*! Create a new ExifMem | | /*! Create a new ExifMem | |
|
| | | * | |
| * \param[in] a the allocator function | | * \param[in] a the allocator function | |
| * \param[in] r the reallocator function | | * \param[in] r the reallocator function | |
| * \param[in] f the free function | | * \param[in] f the free function | |
| */ | | */ | |
| ExifMem *exif_mem_new (ExifMemAllocFunc a, ExifMemReallocFunc r, | | ExifMem *exif_mem_new (ExifMemAllocFunc a, ExifMemReallocFunc r, | |
| ExifMemFreeFunc f); | | ExifMemFreeFunc f); | |
| /*! Refcount an ExifMem | | /*! Refcount an ExifMem | |
| */ | | */ | |
| void exif_mem_ref (ExifMem *); | | void exif_mem_ref (ExifMem *); | |
|
| /*! Unrefcount an ExifMem | | | |
| | | /*! Unrefcount an ExifMem. | |
| * If the refcount reaches 0, the ExifMem is freed | | * If the refcount reaches 0, the ExifMem is freed | |
| */ | | */ | |
| void exif_mem_unref (ExifMem *); | | void exif_mem_unref (ExifMem *); | |
| | | | |
| void *exif_mem_alloc (ExifMem *m, ExifLong s); | | void *exif_mem_alloc (ExifMem *m, ExifLong s); | |
| void *exif_mem_realloc (ExifMem *m, void *p, ExifLong s); | | void *exif_mem_realloc (ExifMem *m, void *p, ExifLong s); | |
| void exif_mem_free (ExifMem *m, void *p); | | void exif_mem_free (ExifMem *m, void *p); | |
| | | | |
| /*! The default ExifMem for your convenience | | /*! The default ExifMem for your convenience | |
|
| * \returns return the default ExifMem | | * | |
| | | * \return return the default ExifMem | |
| */ | | */ | |
| ExifMem *exif_mem_new_default (void); | | ExifMem *exif_mem_new_default (void); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #endif /* __EXIF_MEM_H__ */ | | #endif /* __EXIF_MEM_H__ */ | |
| | | | |
End of changes. 11 change blocks. |
| 6 lines changed or deleted | | 12 lines changed or added | |
|
| exif-mnote-data.h | | exif-mnote-data.h | |
|
| /* exif-mnote-data.h | | /*! \file exif-mnote-data.h | |
| * | | * \brief Handling EXIF MakerNote tags | |
| | | */ | |
| | | /* | |
| * Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net> | | * Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net> | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | | * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | | * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | | * version 2 of the License, or (at your option) any later version. | |
| * | | * | |
| * This library is distributed in the hope that it will be useful, | | * This library is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 32 | |
| | | | |
| #ifndef __EXIF_MNOTE_DATA_H__ | | #ifndef __EXIF_MNOTE_DATA_H__ | |
| #define __EXIF_MNOTE_DATA_H__ | | #define __EXIF_MNOTE_DATA_H__ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #include <libexif/exif-log.h> | | #include <libexif/exif-log.h> | |
| | | | |
|
| | | /*! Data found in the MakerNote tag */ | |
| typedef struct _ExifMnoteData ExifMnoteData; | | typedef struct _ExifMnoteData ExifMnoteData; | |
| | | | |
| void exif_mnote_data_ref (ExifMnoteData *); | | void exif_mnote_data_ref (ExifMnoteData *); | |
| void exif_mnote_data_unref (ExifMnoteData *); | | void exif_mnote_data_unref (ExifMnoteData *); | |
| | | | |
|
| void exif_mnote_data_load (ExifMnoteData *, const unsigned char *, | | /*! Load the MakerNote data from a memory buffer. | |
| unsigned int); | | * | |
| void exif_mnote_data_save (ExifMnoteData *, unsigned char **, unsigned int | | * \param[in] d MakerNote data | |
| *); | | * \param[in] buf pointer to raw MakerNote tag data | |
| | | * \param[in] buf_siz number of bytes of data at buf | |
| unsigned int exif_mnote_data_count (ExifMnoteData *); | | */ | |
| unsigned int exif_mnote_data_get_id (ExifMnoteData *, unsigned int | | void exif_mnote_data_load (ExifMnoteData *d, const unsigned char *buf, | |
| ); | | unsigned int buf_siz); | |
| const char *exif_mnote_data_get_name (ExifMnoteData *, unsigned int | | | |
| ); | | /*! | |
| const char *exif_mnote_data_get_title (ExifMnoteData *, unsigned int | | * Save the raw MakerNote data into a memory buffer. The buffer is | |
| ); | | * allocated by this function and must subsequently be freed by the | |
| const char *exif_mnote_data_get_description (ExifMnoteData *, unsigned int | | * caller. | |
| ); | | * | |
| | | * \param[in,out] d extract the data from this structure | |
| | | * \param[out] buf pointer to buffer pointer containing MakerNote data on r | |
| | | eturn | |
| | | * \param[out] buf_siz pointer to the size of the buffer | |
| | | */ | |
| | | void exif_mnote_data_save (ExifMnoteData *d, unsigned char **buf, | |
| | | unsigned int *buf_siz); | |
| | | | |
| | | /*! Return the number of tags in the MakerNote. | |
| | | * | |
| | | * \param[in] d MakerNote data | |
| | | * \return number of tags, or 0 if no MakerNote or the type is not supporte | |
| | | d | |
| | | */ | |
| | | unsigned int exif_mnote_data_count (ExifMnoteData *d); | |
| | | | |
| | | /*! Return the MakerNote tag number for the tag at the specified index with | |
| | | in | |
| | | * the MakerNote. | |
| | | * | |
| | | * \param[in] d MakerNote data | |
| | | * \param[in] n index of the entry within the MakerNote data | |
| | | * \return MakerNote tag number | |
| | | */ | |
| | | unsigned int exif_mnote_data_get_id (ExifMnoteData *d, unsigned in | |
| | | t n); | |
| | | | |
|
| /* Returns NULL or val */ | | /*! Returns textual name of the given MakerNote tag. The name is a short, | |
| char *exif_mnote_data_get_value (ExifMnoteData *, unsigned int, char *val, | | * unique (within this type of MakerNote), non-localized text string | |
| unsigned int maxlen); | | * containing only US-ASCII alphanumeric characters. | |
| | | * | |
| | | * \param[in] d MakerNote data | |
| | | * \param[in] n index of the entry within the MakerNote data | |
| | | * \return textual name of the tag | |
| | | */ | |
| | | const char *exif_mnote_data_get_name (ExifMnoteData *d, unsigned in | |
| | | t n); | |
| | | | |
| | | /*! Returns textual title of the given MakerNote tag. | |
| | | * The title is a short, localized textual description of the tag. | |
| | | * | |
| | | * \param[in] d MakerNote data | |
| | | * \param[in] n index of the entry within the MakerNote data | |
| | | * \return textual name of the tag | |
| | | */ | |
| | | const char *exif_mnote_data_get_title (ExifMnoteData *d, unsigned in | |
| | | t n); | |
| | | | |
| | | /*! Returns verbose textual description of the given MakerNote tag. | |
| | | * | |
| | | * \param[in] d MakerNote data | |
| | | * \param[in] n index of the entry within the MakerNote data | |
| | | * \return textual description of the tag | |
| | | */ | |
| | | const char *exif_mnote_data_get_description (ExifMnoteData *d, unsigned in | |
| | | t n); | |
| | | | |
| | | /*! Return a textual representation of the value of the MakerNote entry. | |
| | | * | |
| | | * \warning The character set of the returned string may be in | |
| | | * the encoding of the current locale or the native encoding | |
| | | * of the camera. | |
| | | * | |
| | | * \param[in] d MakerNote data | |
| | | * \param[in] n index of the entry within the MakerNote data | |
| | | * \param[out] val buffer in which to store value | |
| | | * \param[in] maxlen length of the buffer val | |
| | | * \return val pointer, or NULL on error | |
| | | */ | |
| | | char *exif_mnote_data_get_value (ExifMnoteData *d, unsigned int n, char *v | |
| | | al, unsigned int maxlen); | |
| | | | |
| void exif_mnote_data_log (ExifMnoteData *, ExifLog *); | | void exif_mnote_data_log (ExifMnoteData *, ExifLog *); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #endif /* __EXIF_MNOTE_DATA_H__ */ | | #endif /* __EXIF_MNOTE_DATA_H__ */ | |
| | | | |
End of changes. 4 change blocks. |
| 19 lines changed or deleted | | 89 lines changed or added | |
|
| exif-tag.h | | exif-tag.h | |
|
| /* exif-tag.h | | /*! \file exif-tag.h | |
| * | | * \brief Handling EXIF tags | |
| | | */ | |
| | | /* | |
| * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> | | * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | | * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | | * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | | * version 2 of the License, or (at your option) any later version. | |
| * | | * | |
| * This library is distributed in the hope that it will be useful, | | * This library is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 33 | |
| #ifndef __EXIF_TAG_H__ | | #ifndef __EXIF_TAG_H__ | |
| #define __EXIF_TAG_H__ | | #define __EXIF_TAG_H__ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #include <libexif/exif-ifd.h> | | #include <libexif/exif-ifd.h> | |
| #include <libexif/exif-data-type.h> | | #include <libexif/exif-data-type.h> | |
| | | | |
|
| | | /*! EXIF tags */ | |
| typedef enum { | | typedef enum { | |
| EXIF_TAG_INTEROPERABILITY_INDEX = 0x0001, | | EXIF_TAG_INTEROPERABILITY_INDEX = 0x0001, | |
| EXIF_TAG_INTEROPERABILITY_VERSION = 0x0002, | | EXIF_TAG_INTEROPERABILITY_VERSION = 0x0002, | |
| EXIF_TAG_NEW_SUBFILE_TYPE = 0x00fe, | | EXIF_TAG_NEW_SUBFILE_TYPE = 0x00fe, | |
| EXIF_TAG_IMAGE_WIDTH = 0x0100, | | EXIF_TAG_IMAGE_WIDTH = 0x0100, | |
| EXIF_TAG_IMAGE_LENGTH = 0x0101, | | EXIF_TAG_IMAGE_LENGTH = 0x0101, | |
| EXIF_TAG_BITS_PER_SAMPLE = 0x0102, | | EXIF_TAG_BITS_PER_SAMPLE = 0x0102, | |
| EXIF_TAG_COMPRESSION = 0x0103, | | EXIF_TAG_COMPRESSION = 0x0103, | |
| EXIF_TAG_PHOTOMETRIC_INTERPRETATION = 0x0106, | | EXIF_TAG_PHOTOMETRIC_INTERPRETATION = 0x0106, | |
| EXIF_TAG_FILL_ORDER = 0x010a, | | EXIF_TAG_FILL_ORDER = 0x010a, | |
| | | | |
| skipping to change at line 88 | | skipping to change at line 91 | |
| EXIF_TAG_FNUMBER = 0x829d, | | EXIF_TAG_FNUMBER = 0x829d, | |
| EXIF_TAG_IPTC_NAA = 0x83bb, | | EXIF_TAG_IPTC_NAA = 0x83bb, | |
| EXIF_TAG_IMAGE_RESOURCES = 0x8649, | | EXIF_TAG_IMAGE_RESOURCES = 0x8649, | |
| EXIF_TAG_EXIF_IFD_POINTER = 0x8769, | | EXIF_TAG_EXIF_IFD_POINTER = 0x8769, | |
| EXIF_TAG_INTER_COLOR_PROFILE = 0x8773, | | EXIF_TAG_INTER_COLOR_PROFILE = 0x8773, | |
| EXIF_TAG_EXPOSURE_PROGRAM = 0x8822, | | EXIF_TAG_EXPOSURE_PROGRAM = 0x8822, | |
| EXIF_TAG_SPECTRAL_SENSITIVITY = 0x8824, | | EXIF_TAG_SPECTRAL_SENSITIVITY = 0x8824, | |
| EXIF_TAG_GPS_INFO_IFD_POINTER = 0x8825, | | EXIF_TAG_GPS_INFO_IFD_POINTER = 0x8825, | |
| EXIF_TAG_ISO_SPEED_RATINGS = 0x8827, | | EXIF_TAG_ISO_SPEED_RATINGS = 0x8827, | |
| EXIF_TAG_OECF = 0x8828, | | EXIF_TAG_OECF = 0x8828, | |
|
| | | EXIF_TAG_TIME_ZONE_OFFSET = 0x882a, | |
| EXIF_TAG_EXIF_VERSION = 0x9000, | | EXIF_TAG_EXIF_VERSION = 0x9000, | |
| EXIF_TAG_DATE_TIME_ORIGINAL = 0x9003, | | EXIF_TAG_DATE_TIME_ORIGINAL = 0x9003, | |
| EXIF_TAG_DATE_TIME_DIGITIZED = 0x9004, | | EXIF_TAG_DATE_TIME_DIGITIZED = 0x9004, | |
| EXIF_TAG_COMPONENTS_CONFIGURATION = 0x9101, | | EXIF_TAG_COMPONENTS_CONFIGURATION = 0x9101, | |
| EXIF_TAG_COMPRESSED_BITS_PER_PIXEL = 0x9102, | | EXIF_TAG_COMPRESSED_BITS_PER_PIXEL = 0x9102, | |
| EXIF_TAG_SHUTTER_SPEED_VALUE = 0x9201, | | EXIF_TAG_SHUTTER_SPEED_VALUE = 0x9201, | |
| EXIF_TAG_APERTURE_VALUE = 0x9202, | | EXIF_TAG_APERTURE_VALUE = 0x9202, | |
| EXIF_TAG_BRIGHTNESS_VALUE = 0x9203, | | EXIF_TAG_BRIGHTNESS_VALUE = 0x9203, | |
| EXIF_TAG_EXPOSURE_BIAS_VALUE = 0x9204, | | EXIF_TAG_EXPOSURE_BIAS_VALUE = 0x9204, | |
| EXIF_TAG_MAX_APERTURE_VALUE = 0x9205, | | EXIF_TAG_MAX_APERTURE_VALUE = 0x9205, | |
| | | | |
| skipping to change at line 182 | | skipping to change at line 186 | |
| #define EXIF_TAG_GPS_DEST_LONGITUDE 0x0016 | | #define EXIF_TAG_GPS_DEST_LONGITUDE 0x0016 | |
| #define EXIF_TAG_GPS_DEST_BEARING_REF 0x0017 | | #define EXIF_TAG_GPS_DEST_BEARING_REF 0x0017 | |
| #define EXIF_TAG_GPS_DEST_BEARING 0x0018 | | #define EXIF_TAG_GPS_DEST_BEARING 0x0018 | |
| #define EXIF_TAG_GPS_DEST_DISTANCE_REF 0x0019 | | #define EXIF_TAG_GPS_DEST_DISTANCE_REF 0x0019 | |
| #define EXIF_TAG_GPS_DEST_DISTANCE 0x001a | | #define EXIF_TAG_GPS_DEST_DISTANCE 0x001a | |
| #define EXIF_TAG_GPS_PROCESSING_METHOD 0x001b | | #define EXIF_TAG_GPS_PROCESSING_METHOD 0x001b | |
| #define EXIF_TAG_GPS_AREA_INFORMATION 0x001c | | #define EXIF_TAG_GPS_AREA_INFORMATION 0x001c | |
| #define EXIF_TAG_GPS_DATE_STAMP 0x001d | | #define EXIF_TAG_GPS_DATE_STAMP 0x001d | |
| #define EXIF_TAG_GPS_DIFFERENTIAL 0x001e | | #define EXIF_TAG_GPS_DIFFERENTIAL 0x001e | |
| | | | |
|
| | | /*! What level of support a tag enjoys in the EXIF standard */ | |
| typedef enum { | | typedef enum { | |
|
| | | /*! The meaning of this tag is unknown */ | |
| EXIF_SUPPORT_LEVEL_UNKNOWN = 0, | | EXIF_SUPPORT_LEVEL_UNKNOWN = 0, | |
|
| | | | |
| | | /*! This tag is not allowed in the given IFD */ | |
| EXIF_SUPPORT_LEVEL_NOT_RECORDED, | | EXIF_SUPPORT_LEVEL_NOT_RECORDED, | |
|
| | | | |
| | | /*! This tag is mandatory in the given IFD */ | |
| EXIF_SUPPORT_LEVEL_MANDATORY, | | EXIF_SUPPORT_LEVEL_MANDATORY, | |
|
| | | | |
| | | /*! This tag is optional in the given IFD */ | |
| EXIF_SUPPORT_LEVEL_OPTIONAL | | EXIF_SUPPORT_LEVEL_OPTIONAL | |
| } ExifSupportLevel; | | } ExifSupportLevel; | |
| | | | |
|
| ExifTag exif_tag_from_name (const char *); | | /*! Return the tag ID given its unique textual name. | |
| const char *exif_tag_get_name_in_ifd (ExifTag, ExifIfd); | | * | |
| const char *exif_tag_get_title_in_ifd (ExifTag, ExifIfd); | | * \param[in] name tag name | |
| const char *exif_tag_get_description_in_ifd (ExifTag, ExifIfd); | | * \return tag ID | |
| ExifSupportLevel exif_tag_get_support_level_in_ifd (ExifTag, ExifIfd, | | */ | |
| ExifDataType); | | ExifTag exif_tag_from_name (const char *name); | |
| | | | |
| | | /*! Return a textual name of the given tag when found in the given IFD. The | |
| | | * name is a short, unique, non-localized text string containing only | |
| | | * US-ASCII alphanumeric characters. | |
| | | * | |
| | | * \param[in] tag EXIF tag | |
| | | * \param[in] ifd IFD | |
| | | * \return textual name of the tag, or NULL if the tag is unknown | |
| | | */ | |
| | | const char *exif_tag_get_name_in_ifd (ExifTag tag, ExifIfd if | |
| | | d); | |
| | | | |
| | | /*! Return a textual title of the given tag when found in the given IFD. | |
| | | * The title is a short, localized description of the tag. | |
| | | * | |
| | | * \param[in] tag EXIF tag | |
| | | * \param[in] ifd IFD | |
| | | * \return textual title of the tag, or NULL if the tag is unknown | |
| | | */ | |
| | | const char *exif_tag_get_title_in_ifd (ExifTag tag, ExifIfd if | |
| | | d); | |
| | | | |
| | | /*! Return a verbose textual description of the given tag when found in the | |
| | | * given IFD. The description is a verbose, localized description of the ta | |
| | | g. | |
| | | * | |
| | | * \param[in] tag EXIF tag | |
| | | * \param[in] ifd IFD | |
| | | * \return textual description of the tag, or NULL if the tag is unknown | |
| | | */ | |
| | | const char *exif_tag_get_description_in_ifd (ExifTag tag, ExifIfd if | |
| | | d); | |
| | | | |
| | | /*! Return whether the given tag is mandatory or not in the given IFD and | |
| | | * data type according to the EXIF specification. If the IFD given is | |
| | | * EXIF_IFD_COUNT, the result is EXIF_SUPPORT_LEVEL_UNKNOWN. If the data | |
| | | * type is EXIF_DATA_TYPE_UNKNOWN, the result is | |
| | | * EXIF_SUPPORT_LEVEL_UNKNOWN unless the support level is the same for | |
| | | * all data types. | |
| | | * | |
| | | * \param[in] tag EXIF tag | |
| | | * \param[in] ifd IFD or EXIF_IFD_COUNT | |
| | | * \param[in] t data type or EXIF_DATA_TYPE_UNKNOWN | |
| | | * \return the level of support for this tag | |
| | | */ | |
| | | ExifSupportLevel exif_tag_get_support_level_in_ifd (ExifTag tag, ExifIfd if | |
| | | d, | |
| | | ExifDataType t); | |
| | | | |
| /* Don't use these functions. They are here for compatibility only. */ | | /* Don't use these functions. They are here for compatibility only. */ | |
|
| | | | |
| | | /*! \deprecated Use #exif_tag_get_name_in_ifd instead */ | |
| const char *exif_tag_get_name (ExifTag tag); | | const char *exif_tag_get_name (ExifTag tag); | |
|
| | | | |
| | | /*! \deprecated Use #exif_tag_get_title_in_ifd instead */ | |
| const char *exif_tag_get_title (ExifTag tag); | | const char *exif_tag_get_title (ExifTag tag); | |
|
| | | | |
| | | /*! \deprecated Use #exif_tag_get_description_in_ifd instead */ | |
| const char *exif_tag_get_description (ExifTag tag); | | const char *exif_tag_get_description (ExifTag tag); | |
| | | | |
|
| | | /* For now, do not use these functions. */ | |
| | | | |
| | | /*! \internal */ | |
| | | ExifTag exif_tag_table_get_tag (unsigned int n); | |
| | | | |
| | | /*! \internal */ | |
| | | const char *exif_tag_table_get_name (unsigned int n); | |
| | | | |
| | | /*! \internal */ | |
| | | unsigned int exif_tag_table_count (void); | |
| | | | |
| /* Don't use these definitions. They are here for compatibility only. */ | | /* Don't use these definitions. They are here for compatibility only. */ | |
|
| | | | |
| | | /*! \deprecated Use EXIF_TAG_PRINT_IMAGE_MATCHING instead. */ | |
| #define EXIF_TAG_UNKNOWN_C4A5 EXIF_TAG_PRINT_IMAGE_MATCHING | | #define EXIF_TAG_UNKNOWN_C4A5 EXIF_TAG_PRINT_IMAGE_MATCHING | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #endif /* __EXIF_TAG_H__ */ | | #endif /* __EXIF_TAG_H__ */ | |
| | | | |
End of changes. 14 change blocks. |
| 8 lines changed or deleted | | 87 lines changed or added | |
|
| exif-utils.h | | exif-utils.h | |
|
| /* exif-utils.h | | /*! \file exif-utils.h | |
| * | | * \brief EXIF data manipulation functions and types | |
| | | */ | |
| | | /* | |
| * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> | | * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | | * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | | * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | | * version 2 of the License, or (at your option) any later version. | |
| * | | * | |
| * This library is distributed in the hope that it will be useful, | | * This library is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| | | | |
| skipping to change at line 35 | | skipping to change at line 37 | |
| extern "C" { | | extern "C" { | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #include <libexif/exif-byte-order.h> | | #include <libexif/exif-byte-order.h> | |
| #include <libexif/exif-format.h> | | #include <libexif/exif-format.h> | |
| #include <libexif/_stdint.h> | | #include <libexif/_stdint.h> | |
| | | | |
| /* If these definitions don't work for you, please let us fix the | | /* If these definitions don't work for you, please let us fix the | |
| * macro generating _stdint.h */ | | * macro generating _stdint.h */ | |
| | | | |
|
| | | /*! EXIF Unsigned Byte data type */ | |
| typedef unsigned char ExifByte; /* 1 byte */ | | typedef unsigned char ExifByte; /* 1 byte */ | |
|
| | | | |
| | | /*! EXIF Signed Byte data type */ | |
| typedef signed char ExifSByte; /* 1 byte */ | | typedef signed char ExifSByte; /* 1 byte */ | |
|
| | | | |
| | | /*! EXIF Text String data type */ | |
| typedef char * ExifAscii; | | typedef char * ExifAscii; | |
|
| | | | |
| | | /*! EXIF Unsigned Short data type */ | |
| typedef uint16_t ExifShort; /* 2 bytes */ | | typedef uint16_t ExifShort; /* 2 bytes */ | |
|
| | | | |
| | | /*! EXIF Signed Short data type */ | |
| typedef int16_t ExifSShort; /* 2 bytes */ | | typedef int16_t ExifSShort; /* 2 bytes */ | |
|
| | | | |
| | | /*! EXIF Unsigned Long data type */ | |
| typedef uint32_t ExifLong; /* 4 bytes */ | | typedef uint32_t ExifLong; /* 4 bytes */ | |
| | | | |
|
| /** EXIF Unsigned Rational */ | | /*! EXIF Signed Long data type */ | |
| | | typedef int32_t ExifSLong; /* 4 bytes */ | |
| | | | |
| | | /*! EXIF Unsigned Rational data type */ | |
| typedef struct {ExifLong numerator; ExifLong denominator;} ExifRational; | | typedef struct {ExifLong numerator; ExifLong denominator;} ExifRational; | |
| | | | |
| typedef char ExifUndefined; /* 1 byte */ | | typedef char ExifUndefined; /* 1 byte */ | |
|
| typedef int32_t ExifSLong; /* 4 bytes */ | | | |
| | | | |
|
| /** EXIF Signed Rational. */ | | /*! EXIF Signed Rational data type */ | |
| typedef struct {ExifSLong numerator; ExifSLong denominator;} ExifSRational; | | typedef struct {ExifSLong numerator; ExifSLong denominator;} ExifSRational; | |
| | | | |
|
| | | /*! Retrieve an #ExifShort value from memory. | |
| | | * | |
| | | * \param[in] b pointer to raw EXIF value in memory | |
| | | * \param[in] order byte order of raw value | |
| | | * \return value | |
| | | */ | |
| ExifShort exif_get_short (const unsigned char *b, ExifByteOrder ord
er); | | ExifShort exif_get_short (const unsigned char *b, ExifByteOrder ord
er); | |
|
| | | | |
| | | /*! Retrieve an #ExifSShort value from memory. | |
| | | * | |
| | | * \param[in] b pointer to raw EXIF value in memory | |
| | | * \param[in] order byte order of raw value | |
| | | * \return value | |
| | | */ | |
| ExifSShort exif_get_sshort (const unsigned char *b, ExifByteOrder ord
er); | | ExifSShort exif_get_sshort (const unsigned char *b, ExifByteOrder ord
er); | |
|
| | | | |
| | | /*! Retrieve an #ExifLong value from memory. | |
| | | * | |
| | | * \param[in] b pointer to raw EXIF value in memory | |
| | | * \param[in] order byte order of raw value | |
| | | * \return value | |
| | | */ | |
| ExifLong exif_get_long (const unsigned char *b, ExifByteOrder ord
er); | | ExifLong exif_get_long (const unsigned char *b, ExifByteOrder ord
er); | |
|
| | | | |
| | | /*! Retrieve an #ExifSLong value from memory. | |
| | | * | |
| | | * \param[in] b pointer to raw EXIF value in memory | |
| | | * \param[in] order byte order of raw value | |
| | | * \return value | |
| | | */ | |
| ExifSLong exif_get_slong (const unsigned char *b, ExifByteOrder ord
er); | | ExifSLong exif_get_slong (const unsigned char *b, ExifByteOrder ord
er); | |
|
| | | | |
| | | /*! Retrieve an #ExifRational value from memory. | |
| | | * | |
| | | * \param[in] b pointer to raw EXIF value in memory | |
| | | * \param[in] order byte order of raw value | |
| | | * \return value | |
| | | */ | |
| ExifRational exif_get_rational (const unsigned char *b, ExifByteOrder ord
er); | | ExifRational exif_get_rational (const unsigned char *b, ExifByteOrder ord
er); | |
|
| | | | |
| | | /*! Retrieve an #ExifSRational value from memory. | |
| | | * | |
| | | * \param[in] b pointer to raw EXIF value in memory | |
| | | * \param[in] order byte order of raw value | |
| | | * \return value | |
| | | */ | |
| ExifSRational exif_get_srational (const unsigned char *b, ExifByteOrder ord
er); | | ExifSRational exif_get_srational (const unsigned char *b, ExifByteOrder ord
er); | |
| | | | |
|
| | | /*! Store an ExifShort value into memory in EXIF format. | |
| | | * | |
| | | * \param[out] b buffer in which to write raw value | |
| | | * \param[in] order byte order to use | |
| | | * \param[in] value data value to store | |
| | | */ | |
| void exif_set_short (unsigned char *b, ExifByteOrder order, | | void exif_set_short (unsigned char *b, ExifByteOrder order, | |
| ExifShort value); | | ExifShort value); | |
|
| | | | |
| | | /*! Store an ExifSShort value into memory in EXIF format. | |
| | | * | |
| | | * \param[out] b buffer in which to write raw value | |
| | | * \param[in] order byte order to use | |
| | | * \param[in] value data value to store | |
| | | */ | |
| void exif_set_sshort (unsigned char *b, ExifByteOrder order, | | void exif_set_sshort (unsigned char *b, ExifByteOrder order, | |
| ExifSShort value); | | ExifSShort value); | |
|
| | | | |
| | | /*! Store an ExifLong value into memory in EXIF format. | |
| | | * | |
| | | * \param[out] b buffer in which to write raw value | |
| | | * \param[in] order byte order to use | |
| | | * \param[in] value data value to store | |
| | | */ | |
| void exif_set_long (unsigned char *b, ExifByteOrder order, | | void exif_set_long (unsigned char *b, ExifByteOrder order, | |
| ExifLong value); | | ExifLong value); | |
|
| | | | |
| | | /*! Store an ExifSLong value into memory in EXIF format. | |
| | | * | |
| | | * \param[out] b buffer in which to write raw value | |
| | | * \param[in] order byte order to use | |
| | | * \param[in] value data value to store | |
| | | */ | |
| void exif_set_slong (unsigned char *b, ExifByteOrder order, | | void exif_set_slong (unsigned char *b, ExifByteOrder order, | |
| ExifSLong value); | | ExifSLong value); | |
|
| | | | |
| | | /*! Store an ExifRational value into memory in EXIF format. | |
| | | * | |
| | | * \param[out] b buffer in which to write raw value | |
| | | * \param[in] order byte order to use | |
| | | * \param[in] value data value to store | |
| | | */ | |
| void exif_set_rational (unsigned char *b, ExifByteOrder order, | | void exif_set_rational (unsigned char *b, ExifByteOrder order, | |
| ExifRational value); | | ExifRational value); | |
|
| | | | |
| | | /*! Store an ExifSRational value into memory in EXIF format. | |
| | | * | |
| | | * \param[out] b buffer in which to write raw value | |
| | | * \param[in] order byte order to use | |
| | | * \param[in] value data value to store | |
| | | */ | |
| void exif_set_srational (unsigned char *b, ExifByteOrder order, | | void exif_set_srational (unsigned char *b, ExifByteOrder order, | |
| ExifSRational value); | | ExifSRational value); | |
| | | | |
|
| | | /*! \internal */ | |
| void exif_convert_utf16_to_utf8 (char *out, const unsigned short *in, int m
axlen); | | void exif_convert_utf16_to_utf8 (char *out, const unsigned short *in, int m
axlen); | |
| | | | |
| /* Please do not use this function outside of the library. */ | | /* Please do not use this function outside of the library. */ | |
|
| | | | |
| | | /*! \internal */ | |
| void exif_array_set_byte_order (ExifFormat, unsigned char *, unsigned int, | | void exif_array_set_byte_order (ExifFormat, unsigned char *, unsigned int, | |
| ExifByteOrder o_orig, ExifByteOrder o_new); | | ExifByteOrder o_orig, ExifByteOrder o_new); | |
| | | | |
| #undef MIN | | #undef MIN | |
| #define MIN(a, b) (((a) < (b)) ? (a) : (b)) | | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) | |
| | | | |
| #undef MAX | | #undef MAX | |
| #define MAX(a, b) (((a) > (b)) ? (a) : (b)) | | #define MAX(a, b) (((a) > (b)) ? (a) : (b)) | |
| | | | |
| /* For compatibility with older versions */ | | /* For compatibility with older versions */ | |
|
| | | | |
| | | /*! \deprecated Use EXIF_TAG_SUB_SEC_TIME instead. */ | |
| #define EXIF_TAG_SUBSEC_TIME EXIF_TAG_SUB_SEC_TIME | | #define EXIF_TAG_SUBSEC_TIME EXIF_TAG_SUB_SEC_TIME | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /* __cplusplus */ | | #endif /* __cplusplus */ | |
| | | | |
| #endif /* __EXIF_UTILS_H__ */ | | #endif /* __EXIF_UTILS_H__ */ | |
| | | | |
End of changes. 25 change blocks. |
| 5 lines changed or deleted | | 107 lines changed or added | |
|