libextractor  1.11
About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.
  Fossies Dox: libextractor-1.11.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

exiv2_extractor.cc File Reference

libextractor plugin for Exif using exiv2 More...

#include "platform.h"
#include "extractor.h"
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <math.h>
#include <exiv2/exiv2.hpp>
Include dependency graph for exiv2_extractor.cc:

Go to the source code of this file.

Data Structures

class  ExtractorIO
 

Macros

#define DEBUG   0
 
#define ADD(s, type)
 
#define ADDEXIV(s, t)
 
#define ADDIPTC(s, t)
 
#define ADDXMP(s, t)
 

Functions

static int add_exiv2_tag (const Exiv2::ExifData &exifData, const std::string &key, enum EXTRACTOR_MetaType type, EXTRACTOR_MetaDataProcessor proc, void *proc_cls)
 
static int add_iptc_data (const Exiv2::IptcData &iptcData, const std::string &key, enum EXTRACTOR_MetaType type, EXTRACTOR_MetaDataProcessor proc, void *proc_cls)
 
static int add_xmp_data (const Exiv2::XmpData &xmpData, const std::string &key, enum EXTRACTOR_MetaType type, EXTRACTOR_MetaDataProcessor proc, void *proc_cls)
 
void EXTRACTOR_exiv2_extract_method (struct EXTRACTOR_ExtractContext *ec)
 

Detailed Description

libextractor plugin for Exif using exiv2

Author
Andreas Huggel (ahu)
Christian Grothoff

Definition in file exiv2_extractor.cc.

Macro Definition Documentation

◆ ADD

#define ADD (   s,
  type 
)
Value:
do { if (0 != proc (proc_cls, "exiv2", type, \
"text/plain", s, strlen (s) \
+ 1)) return 1; \
} while (0)
@ EXTRACTOR_METAFORMAT_UTF8
Definition: extractor.h:102
enum EXTRACTOR_MetaType type

Pass the given UTF-8 string to the 'proc' callback using the given type. Uses 'return 1' if 'proc' returns non-0.

Parameters
s0-terminated UTF8 string value with the meta data
typelibextractor type for the meta data

Definition at line 574 of file exiv2_extractor.cc.

◆ ADDEXIV

#define ADDEXIV (   s,
 
)
Value:
do { if (0 != add_exiv2_tag (exifData, s, t, ec->proc, \
ec->cls)) return; } while (0)
static int add_exiv2_tag(const Exiv2::ExifData &exifData, const std::string &key, enum EXTRACTOR_MetaType type, EXTRACTOR_MetaDataProcessor proc, void *proc_cls)

Call 'add_exiv2_tag' for the given key-type combination. Uses 'return' if add_exiv2_tag returns non-0.

Parameters
skey to lookup
typelibextractor type to use for the meta data found under the given key

Definition at line 701 of file exiv2_extractor.cc.

◆ ADDIPTC

#define ADDIPTC (   s,
 
)
Value:
do { if (0 != add_iptc_data (iptcData, s, t, ec->proc, \
ec->cls)) return; } while (0)
static int add_iptc_data(const Exiv2::IptcData &iptcData, const std::string &key, enum EXTRACTOR_MetaType type, EXTRACTOR_MetaDataProcessor proc, void *proc_cls)

Call 'add_iptc_data' for the given key-type combination. Uses 'return' if add_iptc_data returns non-0.

Parameters
skey to lookup
typelibextractor type to use for the meta data found under the given key

Definition at line 712 of file exiv2_extractor.cc.

◆ ADDXMP

#define ADDXMP (   s,
 
)
Value:
do { if (0 != add_xmp_data (xmpData, s, t, ec->proc, \
ec->cls)) return; } while (0)
static int add_xmp_data(const Exiv2::XmpData &xmpData, const std::string &key, enum EXTRACTOR_MetaType type, EXTRACTOR_MetaDataProcessor proc, void *proc_cls)

Call 'add_xmp_data' for the given key-type combination. Uses 'return' if add_xmp_data returns non-0.

Parameters
skey to lookup
typelibextractor type to use for the meta data found under the given key

Definition at line 723 of file exiv2_extractor.cc.

◆ DEBUG

#define DEBUG   0

Enable debugging to get error messages.

Definition at line 35 of file exiv2_extractor.cc.

Function Documentation

◆ add_exiv2_tag()

static int add_exiv2_tag ( const Exiv2::ExifData &  exifData,
const std::string &  key,
enum EXTRACTOR_MetaType  type,
EXTRACTOR_MetaDataProcessor  proc,
void *  proc_cls 
)
static

Try to find a given key in the exifData and if a value is found, pass it to 'proc'.

Parameters
exifDatametadata set to inspect
keykey to lookup in exifData
typeextractor type to use
procfunction to call with results
proc_clsclosurer for proc
Returns
0 to continue extracting, 1 to abort

Definition at line 593 of file exiv2_extractor.cc.

References ADD, and type.

◆ add_iptc_data()

static int add_iptc_data ( const Exiv2::IptcData &  iptcData,
const std::string &  key,
enum EXTRACTOR_MetaType  type,
EXTRACTOR_MetaDataProcessor  proc,
void *  proc_cls 
)
static

Try to find a given key in the iptcData and if a value is found, pass it to 'proc'.

Parameters
ipctDatametadata set to inspect
keykey to lookup in exifData
typeextractor type to use
procfunction to call with results
proc_clsclosurer for proc
Returns
0 to continue extracting, 1 to abort

Definition at line 629 of file exiv2_extractor.cc.

References ADD, and type.

◆ add_xmp_data()

static int add_xmp_data ( const Exiv2::XmpData &  xmpData,
const std::string &  key,
enum EXTRACTOR_MetaType  type,
EXTRACTOR_MetaDataProcessor  proc,
void *  proc_cls 
)
static

Try to find a given key in the xmpData and if a value is found, pass it to 'proc'.

Parameters
xmpDatametadata set to inspect
keykey to lookup in exifData
typeextractor type to use
procfunction to call with results
proc_clsclosurer for proc
Returns
0 to continue extracting, 1 to abort

Definition at line 668 of file exiv2_extractor.cc.

References ADD, and type.

◆ EXTRACTOR_exiv2_extract_method()