58 if (!mem)
return NULL;
104 if (!content)
return;
106 for (i = 0; i < content->
count; i++)
128 l =
MIN(
sizeof(buf)-1, 2*indent);
132 printf (
"%sDumping exif content (%u entries)...\n", buf,
134 for (i = 0; i < content->
count; i++)
142 if (!c || !c->
priv || !entry || entry->
parent)
return;
147 "An attempt has been made to add "
148 "the tag '%s' twice to an IFD. This is against "
155 if (!entries)
return;
157 entries[c->
count++] = entry;
168 if (!c || !c->
priv || !e || (e->
parent != c))
return;
171 for (i = 0; i < c->
count; i++)
189 memmove (&t[i], &t[i + 1],
sizeof (
ExifEntry*) * (c->
count - i - 1));
190 t[c->
count-1] = temp;
209 for (i = 0; i < content->
count; i++)
221 if (!content || !func)
224 for (i = 0; i < content->
count; i++)
225 func (content->
entries[i], data);
231 if (!content || !content->
priv || !log || content->
priv->
log == log)
276 "Tag 0x%04x is not recorded in IFD '%s' and has therefore been "
311 }
while (num != c->
count);
317 for (i = 0; i < num; ++i) {
325 "Tag '%s' is mandatory in IFD '%s' and has therefore been added.",
void exif_content_remove_entry(ExifContent *c, ExifEntry *e)
Remove an EXIF tag from an IFD.
ExifIfd exif_content_get_ifd(ExifContent *c)
Return the IFD number in which the given ExifContent is found.
void exif_content_fix(ExifContent *c)
Fix the IFD to bring it into specification.
static void fix_func(ExifEntry *e, void *UNUSED(data))
void exif_content_ref(ExifContent *content)
Increase reference counter for ExifContent.
void exif_content_unref(ExifContent *content)
Decrease reference counter for ExifContent.
void exif_content_add_entry(ExifContent *c, ExifEntry *entry)
Add an EXIF tag to an IFD.
ExifContent * exif_content_new_mem(ExifMem *mem)
Reserve memory for and initialize new ExifContent using the specified memory allocator.
void exif_content_dump(ExifContent *content, unsigned int indent)
Dump contents of the IFD to stdout.
ExifEntry * exif_content_get_entry(ExifContent *content, ExifTag tag)
Return the ExifEntry in this IFD corresponding to the given tag.
void exif_content_log(ExifContent *content, ExifLog *log)
Set the log message object for this IFD.
static void remove_not_recorded(ExifEntry *e, void *UNUSED(data))
Check if this entry is unknown and if so, delete it.
ExifContent * exif_content_new(void)
Reserve memory for and initialize a new ExifContent.
void exif_content_foreach_entry(ExifContent *content, ExifContentForeachEntryFunc func, void *data)
Executes function on each EXIF tag in this IFD in turn.
void exif_content_free(ExifContent *content)
Actually free the ExifContent.
void(* ExifContentForeachEntryFunc)(ExifEntry *, void *user_data)
ExifDataType
Represents the type of image data to which the EXIF data applies.
ExifDataType exif_data_get_data_type(ExifData *d)
Return the data type for the given ExifData.
ExifEntry * exif_entry_new(void)
Reserve memory for and initialize a new ExifEntry.
void exif_entry_unref(ExifEntry *e)
Decrease reference counter for ExifEntry.
void exif_entry_fix(ExifEntry *e)
Fix the type or format of the given EXIF entry to bring it into spec.
void exif_entry_initialize(ExifEntry *e, ExifTag tag)
Initialize an empty ExifEntry with default data in the correct format for the given tag.
void exif_entry_dump(ExifEntry *e, unsigned int indent)
Dump text representation of ExifEntry to stdout.
void exif_entry_ref(ExifEntry *e)
Increase reference counter for ExifEntry.
#define exif_entry_get_ifd(e)
Return the IFD number of the given ExifEntry.
const char * exif_ifd_get_name(ExifIfd ifd)
Return a textual name of the given IFD.
ExifIfd
Possible EXIF Image File Directories.
@ EXIF_IFD_INTEROPERABILITY
@ EXIF_IFD_COUNT
Not a real value, just (max_value + 1).
void exif_log(ExifLog *log, ExifLogCode code, const char *domain, const char *format,...)
void exif_log_unref(ExifLog *log)
void exif_log_ref(ExifLog *log)
void * exif_mem_realloc(ExifMem *mem, void *d, ExifLong ds)
void exif_mem_free(ExifMem *mem, void *d)
void exif_mem_unref(ExifMem *mem)
Unrefcount an ExifMem.
ExifMem * exif_mem_new_default(void)
Create a new ExifMem with default values for your convenience.
void * exif_mem_alloc(ExifMem *mem, ExifLong ds)
void exif_mem_ref(ExifMem *mem)
Refcount an ExifMem.
System specific definitions, not for installation!
const char * exif_tag_get_name(ExifTag tag)
ExifTag exif_tag_table_get_tag(unsigned int n)
const char * exif_tag_get_name_in_ifd(ExifTag tag, ExifIfd ifd)
Return a textual name of the given tag when found in the given IFD.
unsigned int exif_tag_table_count(void)
Return the number of entries in the EXIF tag table, including the terminating NULL entry.
ExifSupportLevel exif_tag_get_support_level_in_ifd(ExifTag tag, ExifIfd ifd, ExifDataType t)
Return whether the given tag is mandatory or not in the given IFD and data type according to the EXIF...
@ EXIF_SUPPORT_LEVEL_NOT_RECORDED
This tag is not allowed in the given IFD.
@ EXIF_SUPPORT_LEVEL_MANDATORY
This tag is mandatory in the given IFD.
uint32_t ExifLong
EXIF Unsigned Long data type.
ExifContentPrivate * priv
ExifData * parent
Data containing this content.
Data found in one EXIF tag.
ExifContent * parent
ExifContent containing this entry.
ExifTag tag
EXIF tag for this entry.