EXIF library (libexif) API  0.6.24
exif-content.h File Reference

Handling EXIF IFDs. More...

Go to the source code of this file.

Data Structures

struct  _ExifContent
 

Macros

#define exif_content_get_value(c, t, v, m)
 Return a textual representation of the EXIF data for a tag. More...
 

Typedefs

typedef struct _ExifContent ExifContent
 Holds all EXIF tags in a single IFD.
 
typedef struct _ExifContentPrivate ExifContentPrivate
 
typedef void(* ExifContentForeachEntryFunc) (ExifEntry *, void *user_data)
 

Functions

ExifContentexif_content_new (void)
 Reserve memory for and initialize a new ExifContent. More...
 
ExifContentexif_content_new_mem (ExifMem *)
 Reserve memory for and initialize new ExifContent using the specified memory allocator. More...
 
void exif_content_ref (ExifContent *content)
 Increase reference counter for ExifContent. More...
 
void exif_content_unref (ExifContent *content)
 Decrease reference counter for ExifContent. More...
 
void exif_content_free (ExifContent *content)
 Actually free the ExifContent. More...
 
void exif_content_add_entry (ExifContent *c, ExifEntry *entry)
 Add an EXIF tag to an IFD. More...
 
void exif_content_remove_entry (ExifContent *c, ExifEntry *e)
 Remove an EXIF tag from an IFD. More...
 
ExifEntryexif_content_get_entry (ExifContent *content, ExifTag tag)
 Return the ExifEntry in this IFD corresponding to the given tag. More...
 
void exif_content_fix (ExifContent *c)
 Fix the IFD to bring it into specification. More...
 
void exif_content_foreach_entry (ExifContent *content, ExifContentForeachEntryFunc func, void *user_data)
 Executes function on each EXIF tag in this IFD in turn. More...
 
ExifIfd exif_content_get_ifd (ExifContent *c)
 Return the IFD number in which the given ExifContent is found. More...
 
void exif_content_dump (ExifContent *content, unsigned int indent)
 Dump contents of the IFD to stdout. More...
 
void exif_content_log (ExifContent *content, ExifLog *log)
 Set the log message object for this IFD. More...
 

Detailed Description

Handling EXIF IFDs.

Macro Definition Documentation

◆ exif_content_get_value

#define exif_content_get_value (   c,
  t,
  v,
 
)
Value:
exif_entry_get_value (exif_content_get_entry (c,t),v,m) : NULL)
ExifEntry * exif_content_get_entry(ExifContent *content, ExifTag tag)
Return the ExifEntry in this IFD corresponding to the given tag.
Definition: exif-content.c:202

Return a textual representation of the EXIF data for a tag.

Parameters
[in]cExifContent* for an IFD
[in]tExifTag to return
[out]vchar* buffer in which to store value
[in]munsigned int length of the buffer v
Returns
the v pointer, or NULL on error

Function Documentation

◆ exif_content_add_entry()

void exif_content_add_entry ( ExifContent c,
ExifEntry entry 
)

Add an EXIF tag to an IFD.

If this tag already exists in the IFD, this function does nothing.

Precondition
The "tag" member of the entry must be set on entry.
Parameters
[out]cIFD
[in]entryEXIF entry to add

References exif_content_get_entry(), _ExifEntry::parent, and _ExifEntry::tag.

◆ exif_content_dump()

void exif_content_dump ( ExifContent content,
unsigned int  indent 
)

Dump contents of the IFD to stdout.

This is intended for diagnostic purposes only.

Parameters
[in]contentIFD data
[in]indenthow many levels deep to indent the data

Referenced by exif_data_dump().

◆ exif_content_fix()

void exif_content_fix ( ExifContent c)

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.

Parameters
[in,out]cEXIF content for an IFD

References exif_content_foreach_entry(), exif_content_get_ifd(), exif_data_get_data_type(), exif_tag_table_count(), and _ExifContent::parent.

◆ exif_content_foreach_entry()

void exif_content_foreach_entry ( ExifContent content,
ExifContentForeachEntryFunc  func,
void *  user_data 
)

Executes function on each EXIF tag in this IFD in turn.

The tags will not necessarily be visited in numerical order.

Parameters
[in,out]contentIFD over which to iterate
[in]funcfunction to call for each entry
[in]user_datadata to pass into func on each call

Referenced by exif_content_fix().

◆ exif_content_free()

void exif_content_free ( ExifContent content)

Actually free the ExifContent.

Deprecated:
Should not be called directly. Use exif_content_ref and exif_content_unref instead.
Parameters
[in]contentExifContent

References exif_entry_unref().

Referenced by exif_content_unref().

◆ exif_content_get_entry()

ExifEntry* exif_content_get_entry ( ExifContent content,
ExifTag  tag 
)

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 be freed or unrefed by the caller.

Parameters
[in]contentEXIF content for an IFD
[in]tagEXIF tag to return
Returns
ExifEntry of the tag, or NULL on error

References _ExifEntry::tag.

Referenced by exif_content_add_entry().

◆ exif_content_get_ifd()

ExifIfd exif_content_get_ifd ( ExifContent c)

Return the IFD number in which the given ExifContent is found.

Parameters
[in]can ExifContent*
Returns
IFD number, or #EXIF_IFD_COUNT on error

References _ExifContent::parent.

Referenced by exif_content_fix().

◆ exif_content_log()

void exif_content_log ( ExifContent content,
ExifLog log 
)

Set the log message object for this IFD.

Parameters
[in]contentIFD
[in]logExifLog*

◆ exif_content_new()

ExifContent* exif_content_new ( void  )

Reserve memory for and initialize a new ExifContent.

Returns
new allocated ExifContent, or NULL on error
See also
exif_content_new_mem, exif_content_unref

References exif_content_new_mem(), exif_mem_new_default(), and exif_mem_unref().

◆ exif_content_new_mem()

ExifContent* exif_content_new_mem ( ExifMem mem)

Reserve memory for and initialize new ExifContent using the specified memory allocator.

Returns
new allocated ExifContent, or NULL on error
See also
exif_content_new, exif_content_unref

Referenced by exif_content_new().

◆ exif_content_ref()

void exif_content_ref ( ExifContent content)

Increase reference counter for ExifContent.

Parameters
[in]contentExifContent
See also
exif_content_unref

◆ exif_content_remove_entry()

void exif_content_remove_entry ( ExifContent c,
ExifEntry e 
)

Remove an EXIF tag from an IFD.

If this tag does not exist in the IFD, this function does nothing.

Parameters
[out]cIFD
[in]eEXIF entry to remove

References _ExifEntry::parent.

◆ exif_content_unref()

void exif_content_unref ( ExifContent content)

Decrease reference counter for ExifContent.

When the reference count drops to zero, free the content.

Parameters
[in]contentExifContent

References exif_content_free().