EXIF library (libexif) API 0.6.22
exif-loader.h File Reference

Defines the ExifLoader type. More...

#include <libexif/exifdata.h>
#include <libexif/exiflog.h>
#include <libexif/exifmem.h>

Go to the source code of this file.

Typedefs

typedef struct _ExifLoader ExifLoader
 Data used by the loader interface.
 

Functions

 EXIF_API (ExifLoader *) exif_loader_new(void)
 Allocate a new ExifLoader.
 
 EXIF_API (void) exif_loader_ref(ExifLoader *loader)
 Increase the refcount of the ExifLoader.
 
 EXIF_API (unsigned char) exif_loader_write(ExifLoader *loader
 Load a buffer into the ExifLoader from a memory buffer.
 
 EXIF_API (ExifData *) exif_loader_get_data(ExifLoader *loader)
 Create an ExifData from the data in the loader.
 

Variables

const char * fname
 
unsigned char * buf
 
unsigned char uint32_t sz
 
const unsigned char uint32_t * buf_size
 
ExifLog * log
 

Detailed Description

Defines the ExifLoader type.

Function Documentation

◆ EXIF_API() [1/4]

EXIF_API ( ExifData )

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.

Note
The ExifData returned is created using its default options, which may take effect before the data is returned. If other options are desired, an ExifData must be created explicitly and data extracted from the loader using exif_loader_get_buf instead.
Parameters
[in]loaderthe loader
Returns
allocated ExifData
See also
exif_loader_get_buf

Create an ExifData from the data in the loader.

Allocate a new ExifData and load EXIF data from a memory buffer.

Allocate a new ExifData and load EXIF data from a JPEG 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.

Returns
allocated ExifData, or NULL on error

Uses an ExifLoader internally to do the loading.

Parameters
[in]pathfilename including path
Returns
allocated ExifData, or NULL on error
Parameters
[in]datapointer to raw JPEG or EXIF data
[in]sizenumber of bytes of data at data
Returns
allocated ExifData, or NULL on error

◆ EXIF_API() [2/4]

EXIF_API ( ExifLoader )

Allocate a new ExifLoader.

Allocate a new ExifLoader using the specified memory allocator.

Returns
allocated ExifLoader
Parameters
[in]memthe ExifMem
Returns
allocated ExifLoader

◆ EXIF_API() [3/4]

EXIF_API ( unsigned char  )

Load a buffer into the ExifLoader from a memory buffer.

Return the raw size of the given EXIF data type.

The relevant data is copied in raw form into the ExifLoader.

Parameters
[in]loaderloader to write to
[in]bufbuffer to read from
[in]szsize of the buffer
Returns
1 while EXIF data is read (or while there is still hope that there will be EXIF data later on), 0 otherwise.

◆ EXIF_API() [4/4]

EXIF_API ( void  )

Increase the refcount of the ExifLoader.

Set the log message object used by this ExifLoader.

Return the raw data read by the loader.

Free any data previously loaded and reset the ExifLoader to its newly-initialized state.

Load a file into the given ExifLoader from the filesystem.

Decrease the refcount of the ExifLoader.

Parameters
[in]loaderthe ExifLoader to increase the refcount of.

If the refcount reaches 0, the loader is freed.

Parameters
[in]loaderExifLoader for which to decrease the refcount

The relevant data is copied in raw form into the ExifLoader.

Parameters
[in]loaderloader to write to
[in]fnamepath to the file to read
[in]loaderthe 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.

Parameters
[in]loaderthe loader
[out]bufread-only pointer to the data read by the loader, or NULL in case of error
[out]buf_sizesize of the data at buf, or 0 in case of error
[in]loaderthe loader
[in]logExifLog