Loading...
Searching...
No Matches
Exiv2 Namespace Reference

Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of the objects of this namespace. More...

## Namespaces

namespace | ImageType
| Supported image formats.
namespace | Internal
| Contains internal objects which are not published and are not part of the libexiv2 API.

## Classes

class | AnyError
| Error class interface. Allows the definition and use of a hierarchy of error classes which can all be handled in one catch block. Inherits from the standard exception base-class, to make life easier for library users (they have the option of catching most things via std::exception). More...
class | AsciiValue
| Value for an Ascii string type. More...
class | AsfVideo
| Class to access ASF video files. More...
class | BasicError
| Simple error class used for exceptions. An output operator is provided to print errors to a stream. More...
class | BasicIo
| An interface for simple binary IO. More...
class | BlockMap
| Utility class provides the block mapping to the part of data. This avoids allocating a single contiguous block of memory to the big data. More...
class | BmffImage
| Class to access BMFF images. More...
class | BmpImage
| Class to access Windows bitmaps. This is just a stub - we only read width and height. More...
class | CommentValue
| Value for an Exif comment. More...
class | Converter
| Metadata conversions. More...
class | Cr2Image
| Class to access raw Canon CR2 images. Exif metadata is supported directly, IPTC is read from the Exif data, if present. More...
class | Cr2Parser
| Stateless parser class for data in CR2 format. Images use this class to decode and encode CR2 data. See class TiffParser for details. More...
class | CrwImage
| Class to access raw Canon CRW images. Only Exif metadata and a comment are supported. CRW format does not contain IPTC metadata. More...
class | CrwParser
class | DataBuf
| Utility class containing a character array. All it does is to take care of memory allocation and deletion. Its primary use is meant to be as a stack variable in functions that need a temporary data buffer. More...
struct | DataBufRef
| Auxiliary type to enable copies and assignments, similar to std::auto_ptr_ref. See http://www.josuttis.com/libbook/auto_ptr.html for a discussion. More...
struct | DataSet
| Details of an IPTC dataset. More...
class | DataValue
| Value for an undefined data type. More...
class | DateValue
| Value for simple ISO 8601 dates More...
class | EpsImage
| Class to access EPS images. More...
class | ExifData
| A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifdatum objects. More...
class | Exifdatum
| An Exif metadatum, consisting of an ExifKey and a Value and methods to manipulate these. More...
class | ExifKey
| Concrete keys for Exif metadata and access to Exif tag reference data. More...
class | ExifParser
| Stateless parser class for Exif data. Images use this class to decode and encode binary Exif data. More...
class | ExifTags
| Access to Exif group and tag lists and misc. tag reference methods, implemented as a static class. More...
class | ExifThumb
| Access and modify an Exif thumbnail image. This class implements manipulators to set and erase the thumbnail image that is optionally embedded in IFD1 of the Exif data. Accessors are provided by the base class, ExifThumbC. More...
class | ExifThumbC
| Access to a Exif thumbnail image. This class provides higher level accessors to the thumbnail image that is optionally embedded in IFD1 of the Exif data. These methods do not write to the Exif metadata. Manipulators are provided in subclass ExifThumb. More...
class | ExvImage
| Helper class to access Exiv2 files. More...
class | FileIo
| Provides binary file IO by implementing the BasicIo interface. More...
class | GifImage
| Class to access raw GIF images. Exif/IPTC metadata are supported directly. More...
struct | GroupInfo
| The details of an Exif group. Groups include IFDs and binary arrays. More...
class | HttpIo
| Provides the http read/write access for the RemoteIo. More...
struct | Iloc
class | Image
| Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2 library. More...
class | ImageFactory
| Returns an Image instance of the specified type. More...
class | INIReader
| Read an INI file into easy-to-access name/value pairs. (Note that I've gone for simplicity here rather than speed, but it should be pretty decent.) More...
class | IoCloser
| Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable in functions that need to ensure BasicIo instances get closed. Useful when functions return errors from many locations. More...
class | IptcData
| A container for IPTC data. This is a top-level class of the Exiv2 library. More...
class | IptcDataSets
| IPTC dataset reference, implemented as a static class. More...
class | Iptcdatum
| An IPTC metadatum ("dataset"), consisting of an IptcKey and a Value and methods to manipulate these. More...
class | IptcKey
| Concrete keys for IPTC metadata. More...
class | IptcParser
| Stateless parser class for IPTC data. Images use this class to decode and encode binary IPTC data. More...
class | Jp2Image
| Class to access JPEG-2000 images. More...
class | JpegBase
| Abstract helper base class to access JPEG images. More...
class | JpegImage
| Class to access JPEG images. More...
class | Key
| Abstract base class defining the Key of a metadatum. Keys are used to identify and group metadata. More...
class | LangAltValue
| Value type for XMP language alternative properties. More...
struct | LangAltValueComparator
| LangAltValueComparator More...
class | LogMsg
| Class for a log message, used by the library. Applications can set the log level and provide a customer log message handler (callback function). More...
struct | MatroskaTags
| Helper structure for the Matroska tags lookup table. More...
class | MatroskaVideo
| Class to access Matroska video files. More...
class | MemIo

Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write implementation ensures that the data passed in is only copied when necessary, i.e., as soon as data is written to the MemIo. The original data is only used for reading. If writes are performed, the changed data can be retrieved using the read methods (since the data used in construction is never modified). More...

class | Metadatum
| Abstract base class defining the interface to access information related to one metadata tag. More...
struct | MimeTypeList
| Structure for TIFF compression to MIME type mappings. More...
class | MrwImage
| Class to access raw Minolta MRW images. Exif metadata is supported directly, IPTC is read from the Exif data, if present. More...
struct | NativePreview
| Native preview information. This is meant to be used only by the PreviewManager. More...
class | OrfImage
| Class to access raw Olympus ORF images. Exif metadata is supported directly, IPTC is read from the Exif data, if present. More...
class | OrfParser
| Stateless parser class for data in ORF format. Images use this class to decode and encode ORF data. See class TiffParser for details. More...
class | PgfImage
| Class to access PGF images. Exif and IPTC metadata are supported directly. More...
struct | Photoshop
| Helper class, has methods to deal with Photoshop "Information Resource Blocks" (IRBs). More...
class | PngImage
| Class to access PNG images. Exif and IPTC metadata are supported directly. More...
class | PreviewImage
| Class that holds preview image properties and data buffer. More...
class | PreviewManager
| Class for extracting preview images from image metadata. More...
struct | PreviewProperties
| Preview image properties. More...
class | PsdImage
| Class to access raw Photoshop images. More...
class | QuickTimeVideo
| Class to access QuickTime video files. More...
class | RafImage
| Class to access raw Fujifilm RAF images. Exif metadata is supported directly, IPTC is read from the Exif data, if present. More...
struct | RecordInfo
| Details of an IPTC record. More...
class | RemoteIo
| Provides remote binary file IO by implementing the BasicIo interface. This is an abstract class. The logics for remote access are implemented in HttpIo, CurlIo, SshIo which are the derived classes of RemoteIo. More...
class | RiffVideo
| Class to access RIFF video files. More...
class | Rw2Image
| Class to access raw Panasonic RW2 images. Exif metadata is supported directly, IPTC and XMP are read from the Exif data, if present. More...
class | Rw2Parser
| Stateless parser class for data in RW2 format. Images use this class to decode and encode RW2 data. Only decoding is currently implemented. See class TiffParser for details. More...
class | RWLock
| Class to provide a Read-Write Lock. More...
class | ScopedReadLock
| Class to provide a ScopedReadLock. The lock is applied by the constructor and released by the destructor. More...
class | ScopedWriteLock
| Class to provide a ScopedWriteLock. The lock is applied by the constructor and released by the destructor. More...
struct | Slice
| Slice (= view) for STL containers. More...
struct | Slice< const container >
| Specialization of slices for constant containers. More...
struct | Slice< const T * >
struct | Slice< T * >
class | StringValue
| Value for string type. More...
class | StringValueBase
| Abstract base class for a string based Value type. More...
struct | TagInfo
| Tag information. More...
class | TgaImage
| Class to access raw TARGA images. This is just a stub - we only read width and height. More...
class | TiffImage
| Class to access TIFF images. Exif metadata is supported directly, IPTC is read from the Exif data, if present. More...
class | TiffParser
| Stateless parser class for data in TIFF format. Images use this class to decode and encode TIFF data. It is a wrapper of the internal class Internal::TiffParserWorker. More...
class | TimeValue
| Value for simple ISO 8601 times. More...
class | TypeInfo
| Type information lookup functions. Implemented as a static class. More...
class | Uri
| A container for URL components. It also provides the method to parse a URL to get the protocol, host, path, port, querystring, username, password. More...
class | UtilsVideo
| Class of utility functions used by the video code. More...
class | Value
| Common interface for all types of values used with metadata. More...
class | ValueType
| Template for a Value of a basic type. This is used for unsigned and signed short, long and rationals. More...
class | WebPImage
| Class to access WEBP video files. More...
class | XmpArrayValue
| Value type for simple arrays. Each item in the array is a simple value, without qualifiers. The array may be an ordered (seq), unordered (bag) or alternative array (alt). The array items must not contain qualifiers. For language alternatives use LangAltValue. More...
class | XmpData
| A container for XMP data. This is a top-level class of the Exiv2 library. More...
class | Xmpdatum
| Information related to an XMP property. An XMP metadatum consists of an XmpKey and a Value and provides methods to manipulate these. More...
class | XmpKey
| Concrete keys for XMP metadata. More...
struct | XmpNsInfo
| Structure mapping XMP namespaces and (preferred) prefixes. More...
class | XmpParser
| Stateless parser class for XMP packets. Images use this class to parse and serialize XMP packets. The parser uses the XMP toolkit to do the job. More...
class | XmpProperties
| XMP property reference, implemented as a static class. More...
struct | XmpPropertyInfo
| Information about one XMP property. More...
class | XmpSidecar
| Class to access XMP sidecar files. They contain only XMP metadata. More...
class | XmpTextValue
| Value type suitable for simple XMP properties and XMP nodes of complex types which are not parsed into specific values. More...
class | XmpValue
| Base class for all Exiv2 values used to store XMP property values. More...
class | XPathIo
| Provides binary IO for the data from stdin and data uri path. More...

## Typedefs

typedef std::map< std::string, std::string > | Dictionary
| typedef for string:string map
typedef Dictionary * | Dictionary_p
| typedef for Dictionary*
typedef Dictionary::const_iterator | Dictionary_i
| typedef for Dictionary iterator
typedef std::set< std::string > | StringSet
| typedef for string set (unique strings)
typedef StringSet * | StringSet_p
| typedef for StringSet*
typedef std::set< std::string >::const_iterator | StringSet_i
| Class to provide a StringSet iterator.
typedef std::vector< std::string > | StringVector
| typedef for string vector
typedef StringVector * | StringVector_p
| typedef for StringVector pointer
typedef StringVector::const_iterator | StringVector_i
| Class to provide a StringVector iterator.
typedef std::vector< uint32_t > | Uint32Vector
| typedef for uint32_t vector
typedef Uint32Vector * | Uint32Vector_p
| typedef for Uint32Vector pointer
typedef Uint32Vector::const_iterator | Uint32Vector_i
| typedef for Uint32Vector iterator
typedef BasicError< char > | Error
| Error class used for exceptions (std::string based)
typedef std::list< Exifdatum > | ExifMetadata
| Container type to hold all metadata.
typedef std::vector< NativePreview > | NativePreviewList
| List of native previews. This is meant to be used only by the PreviewManager.
typedef Image::AutoPtr(* | NewInstanceFct) (BasicIo::AutoPtr io, bool create)
| Type for function pointer that creates new Image instances.
typedef bool(* | IsThisTypeFct) (BasicIo &iIo, bool advance)
| Type for function pointer that checks image types.
typedef int(* | ini_handler) (void *user, const char *section, const char *name, const char *value)
| typedef for prototype of handler function.
typedef char *(* | ini_reader) (char *str, int num, void *stream)
| Typedef for prototype of fgets-style reader function.
typedef std::vector< Iptcdatum > | IptcMetadata
| Container type to hold all metadata.
typedef int | PreviewId
| Type of preview image.
typedef std::vector< PreviewProperties > | PreviewPropertiesList
| Container type to hold all preview images metadata.
typedef std::ostream &(* | PrintFct) (std::ostream &, const Value &, const ExifData *pExifData)
| Type for a function pointer for functions interpreting the tag value.
typedef const TagInfo *(* | TagListFct) ()
| A function returning a tag list.
typedef uint8_t | byte
| 1 byte unsigned integer type.
typedef std::pair< uint32_t, uint32_t > | URational
| 8 byte unsigned rational type.
typedef std::pair< int32_t, int32_t > | Rational
| 8 byte signed rational type.
typedef std::vector< byte > | Blob
| Container for binary data.
typedef ValueType< uint16_t > | UShortValue
| Unsigned short value type.
typedef ValueType< uint32_t > | ULongValue
| Unsigned long value type.
typedef ValueType< URational > | URationalValue
| Unsigned rational value type.
typedef ValueType< int16_t > | ShortValue
| Signed short value type.
typedef ValueType< int32_t > | LongValue
| Signed long value type.
typedef ValueType< Rational > | RationalValue
| Signed rational value type.
typedef ValueType< float > | FloatValue
| Float value type.
typedef ValueType< double > | DoubleValue
| Double value type.
typedef std::vector< Xmpdatum > | XmpMetadata
| Container type to hold all metadata.

## Enumerations

enum

ErrorCode {
kerGeneralError = -1 , kerSuccess = 0 , kerErrorMessage , kerCallFailed ,
kerNotAnImage , kerInvalidDataset , kerInvalidRecord , kerInvalidKey ,
kerInvalidTag , kerValueNotSet , kerDataSourceOpenFailed , kerFileOpenFailed ,
kerFileContainsUnknownImageType , kerMemoryContainsUnknownImageType , kerUnsupportedImageType , kerFailedToReadImageData ,
kerNotAJpeg , kerFailedToMapFileForReadWrite , kerFileRenameFailed , kerTransferFailed ,
kerMemoryTransferFailed , kerInputDataReadFailed , kerImageWriteFailed , kerNoImageInInputData ,
kerInvalidIfdId , kerValueTooLarge , kerDataAreaValueTooLarge , kerOffsetOutOfRange ,
kerUnsupportedDataAreaOffsetType , kerInvalidCharset , kerUnsupportedDateFormat , kerUnsupportedTimeFormat ,
kerWritingImageFormatUnsupported , kerInvalidSettingForImage , kerNotACrwImage , kerFunctionNotSupported ,
kerNoNamespaceInfoForXmpPrefix , kerNoPrefixForNamespace , kerTooLargeJpegSegment , kerUnhandledXmpdatum ,
kerUnhandledXmpNode , kerXMPToolkitError , kerDecodeLangAltPropertyFailed , kerDecodeLangAltQualifierFailed ,
kerEncodeLangAltPropertyFailed , kerPropertyNameIdentificationFailed , kerSchemaNamespaceNotRegistered , kerNoNamespaceForPrefix ,
kerAliasesNotSupported , kerInvalidXmpText , kerTooManyTiffDirectoryEntries , kerMultipleTiffArrayElementTagsInDirectory ,
kerWrongTiffArrayElementTagType , kerInvalidKeyXmpValue , kerInvalidIccProfile , kerInvalidXMP ,
kerTiffDirectoryTooLarge , kerInvalidTypeValue , kerInvalidLangAltValue , kerInvalidMalloc ,
kerCorruptedMetadata , kerArithmeticOverflow , kerMallocFailed
}

| Complete list of all Exiv2 error codes. More...
enum | EnVar { envHTTPPOST = 0 , envTIMEOUT = 1 }
| the name of environmental variables.
enum | Protocol { pFile = 0 , pHttp , pFtp , pHttps , pSftp , pSsh , pFileUri , pDataUri , pStdin }
| the collection of protocols.
enum | PrintStructureOption { kpsNone , kpsBasic , kpsXMP , kpsRecursive , kpsIccProfile , kpsIptcErase }
| Options for printStructure.
enum | XmpCategory { xmpInternal , xmpExternal }
| Category of an XMP property.
enum | ByteOrder { invalidByteOrder , littleEndian , bigEndian }
| Type to express the byte order (little or big endian)
enum | WriteMethod { wmIntrusive , wmNonIntrusive }
| Type to indicate write method used by TIFF parsers.
enum | MetadataId { mdNone =0 , mdExif =1 , mdIptc =2 , mdComment =4 , mdXmp =8 , mdIccProfile =16 }
| An identifier for each type of metadata.
enum | AccessMode { amNone =0 , amRead =1 , amWrite =2 , amReadWrite =3 }
| An identifier for each mode of metadata support.

enum

TypeId {
unsignedByte = 1 , asciiString = 2 , unsignedShort = 3 , unsignedLong = 4 ,
unsignedRational = 5 , signedByte = 6 , undefined = 7 , signedShort = 8 ,
signedLong = 9 , signedRational =10 , tiffFloat =11 , tiffDouble =12 ,
tiffIfd =13 , unsignedLongLong =16 , signedLongLong =17 , tiffIfd8 =18 ,
string =0x10000 , date =0x10001 , time =0x10002 , comment =0x10003 ,
directory =0x10004 , xmpText =0x10005 , xmpAlt =0x10006 , xmpBag =0x10007 ,
xmpSeq =0x10008 , langAlt =0x10009 , invalidTypeId =0x1fffe , lastTypeId =0x1ffff
}

| Exiv2 value type identifiers. More...

## Functions

EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr | newAsfInstance (BasicIo::AutoPtr io, bool create)
| Create a new AsfVideo instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2LIB_DEPRECATED_EXPORT bool | isAsfType (BasicIo &iIo, bool advance)
| Check if the file iIo is a Windows Asf Video.
EXIV2API DataBuf | readFile (const std::string &path)
| Read file path into a DataBuf, which is returned.
EXIV2API long | writeFile (const DataBuf &buf, const std::string &path)
| Write DataBuf buf to file path.
EXIV2API std::string | ReplaceStringInPlace (std::string subject, const std::string &search, const std::string &replace)
| replace each substring of the subject that matches the given search string with the given replacement.
EXIV2API bool | enableBMFF (bool enable=true)
EXIV2API Image::AutoPtr | newBmffInstance (BasicIo::AutoPtr io, bool create)
| Create a new BMFF instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isBmffType (BasicIo &iIo, bool advance)
| Check if the file iIo is a BMFF image.
EXIV2API Image::AutoPtr | newBmpInstance (BasicIo::AutoPtr io, bool create)
| Create a new BmpImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isBmpType (BasicIo &iIo, bool advance)
| Check if the file iIo is a Windows Bitmap image.
EXIV2API void | copyExifToXmp (const ExifData &exifData, XmpData &xmpData)
| Convert (copy) Exif tags to XMP properties.
EXIV2API void | moveExifToXmp (ExifData &exifData, XmpData &xmpData)
| Convert (move) Exif tags to XMP properties, remove converted Exif tags.
EXIV2API void | copyXmpToExif (const XmpData &xmpData, ExifData &exifData)
| Convert (copy) XMP properties to Exif tags.
EXIV2API void | moveXmpToExif (XmpData &xmpData, ExifData &exifData)
| Convert (move) XMP properties to Exif tags, remove converted XMP properties.
EXIV2API void | syncExifWithXmp (ExifData &exifData, XmpData &xmpData)
| Detect which metadata are newer and perform a copy in appropriate direction.
EXIV2API void | copyIptcToXmp (const IptcData &iptcData, XmpData &xmpData, const char *iptcCharset=0)
| Convert (copy) IPTC datasets to XMP properties.
EXIV2API void | moveIptcToXmp (IptcData &iptcData, XmpData &xmpData, const char *iptcCharset=0)
| Convert (move) IPTC datasets to XMP properties, remove converted IPTC datasets.
EXIV2API void | copyXmpToIptc (const XmpData &xmpData, IptcData &iptcData)
| Convert (copy) XMP properties to IPTC datasets.
EXIV2API void | moveXmpToIptc (XmpData &xmpData, IptcData &iptcData)
| Convert (move) XMP properties to IPTC tags, remove converted XMP properties.
EXIV2API bool | convertStringCharset (std::string &str, const char *from, const char *to)
| Convert character encoding of str from from to to. If the function succeeds, str contains the result string.
EXIV2API Image::AutoPtr | newCr2Instance (BasicIo::AutoPtr io, bool create)
| Create a new Cr2Image instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isCr2Type (BasicIo &iIo, bool advance)
| Check if the file iIo is a CR2 image.
EXIV2API Image::AutoPtr | newCrwInstance (BasicIo::AutoPtr io, bool create)
| Create a new CrwImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isCrwType (BasicIo &iIo, bool advance)
| Check if the file iIo is a CRW image.
EXIV2API std::ostream & | operator<< (std::ostream &os, const DataSet &dataSet)
| Output operator for dataSet.
EXIV2API ExifData::const_iterator | orientation (const ExifData &ed)
| Return the orientation of the image.
EXIV2API ExifData::const_iterator | isoSpeed (const ExifData &ed)
| Return the ISO speed used to shoot the image.
EXIV2API ExifData::const_iterator | dateTimeOriginal (const ExifData &ed)
| Return the date and time when the original image data was generated.
EXIV2API ExifData::const_iterator | flashBias (const ExifData &ed)
| Return the flash bias value.
EXIV2API ExifData::const_iterator | exposureMode (const ExifData &ed)
| Return the exposure mode setting.
EXIV2API ExifData::const_iterator | sceneMode (const ExifData &ed)
| Return the scene mode setting.
EXIV2API ExifData::const_iterator | macroMode (const ExifData &ed)
| Return the macro mode setting.
EXIV2API ExifData::const_iterator | imageQuality (const ExifData &ed)
| Return the image quality setting.
EXIV2API ExifData::const_iterator | whiteBalance (const ExifData &ed)
| Return the white balance setting.
EXIV2API ExifData::const_iterator | lensName (const ExifData &ed)
| Return the name of the lens used.
EXIV2API ExifData::const_iterator | saturation (const ExifData &ed)
| Return the saturation level.
EXIV2API ExifData::const_iterator | sharpness (const ExifData &ed)
| Return the sharpness level.
EXIV2API ExifData::const_iterator | contrast (const ExifData &ed)
| Return the contrast level.
EXIV2API ExifData::const_iterator | sceneCaptureType (const ExifData &ed)
| Return the scene capture type.
EXIV2API ExifData::const_iterator | meteringMode (const ExifData &ed)
| Return the metering mode setting.
EXIV2API ExifData::const_iterator | make (const ExifData &ed)
| Return the camera make.
EXIV2API ExifData::const_iterator | model (const ExifData &ed)
| Return the camera model.
EXIV2API ExifData::const_iterator | exposureTime (const ExifData &ed)
| Return the exposure time.
EXIV2API ExifData::const_iterator | fNumber (const ExifData &ed)
| Return the F number.
EXIV2API ExifData::const_iterator | shutterSpeedValue (const ExifData &ed)
| Return the shutter speed value.
EXIV2API ExifData::const_iterator | apertureValue (const ExifData &ed)
| Return the aperture value.
EXIV2API ExifData::const_iterator | brightnessValue (const ExifData &ed)
| Return the brightness value.
EXIV2API ExifData::const_iterator | exposureBiasValue (const ExifData &ed)
| Return the exposure bias value.
EXIV2API ExifData::const_iterator | maxApertureValue (const ExifData &ed)
| Return the max aperture value.
EXIV2API ExifData::const_iterator | subjectDistance (const ExifData &ed)
| Return the subject distance.
EXIV2API ExifData::const_iterator | lightSource (const ExifData &ed)
| Return the kind of light source.
EXIV2API ExifData::const_iterator | flash (const ExifData &ed)
| Return the status of flash.
EXIV2API ExifData::const_iterator | serialNumber (const ExifData &ed)
| Return the camera serial number.
EXIV2API ExifData::const_iterator | focalLength (const ExifData &ed)
| Return the focal length setting.
EXIV2API ExifData::const_iterator | subjectArea (const ExifData &ed)
| Return the subject location and area.
EXIV2API ExifData::const_iterator | flashEnergy (const ExifData &ed)
| Return the flash energy.
EXIV2API ExifData::const_iterator | exposureIndex (const ExifData &ed)
| Return the exposure index.
EXIV2API ExifData::const_iterator | sensingMethod (const ExifData &ed)
| Return the image sensor type.
EXIV2API ExifData::const_iterator | afPoint (const ExifData &ed)
| Return the AF point.
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr | newEpsInstance (BasicIo::AutoPtr io, bool create)
| Create a new EpsImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2LIB_DEPRECATED_EXPORT bool | isEpsType (BasicIo &iIo, bool advance)
| Check if the file iIo is a EPS image.
template<typename charT , typename T >
std::basic_string< charT > | toBasicString (const T &arg)
| Generalised toString function.
std::ostream & | operator<< (std::ostream &os, const AnyError &error)
| AnyError output operator
const char * | errMsg (int code)
| Return the error message for the error with code code.
EXIV2API std::string | getEnv (int env_var)
| Return the value of environmental variable.
EXIV2API std::string | urlencode (const char *str)
| Encode the input url.
EXIV2API char * | urldecode (const char *str)
| Decode the input url.
EXIV2API void | urldecode (std::string &str)
| Like urlencode(char* str) but accept the input url in the std::string and modify it.
EXIV2API int | base64encode (const void *data_buf, size_t dataLength, char *result, size_t resultSize)
| Encode in base64 the data in data_buf and put the resulting string in result.
EXIV2API long | base64decode (const char *in, char *out, size_t out_size)
| Decode base64 data and put the resulting string in out.
EXIV2API Protocol | fileProtocol (const std::string &path)
| Return the protocol of the path.
EXIV2API bool | fileExists (const std::string &path, bool ct=false)
| Test if a file exists.
EXIV2API std::string | pathOfFileUrl (const std::string &url)
| Get the path of file URL.
EXIV2API std::string | strError ()
| Return a system error message and the error code (errno). See strerror(3).
EXIV2API std::string | getProcessPath ()
| Return the path of the current process.
EXIV2API Image::AutoPtr | newGifInstance (BasicIo::AutoPtr io, bool create)
| Create a new GifImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isGifType (BasicIo &iIo, bool advance)
| Check if the file iIo is a GIF image.
EXIV2API int | http (Exiv2::Dictionary &request, Exiv2::Dictionary &response, std::string &errors)
| execute an HTTP request
EXIV2API void | append (Exiv2::Blob &blob, const byte *buf, uint32_t len)
| Append len bytes pointed to by buf to blob.
int | ini_parse (const char *filename, ini_handler handler, void *user)
| Parse given INI-style file. May have [section]s, name=value pairs (whitespace stripped), and comments starting with ';' (semicolon). Section is "" if name=value pair parsed before any section heading. name:value pairs are also supported as a concession to Python's configparser.
int | ini_parse_file (FILE *file, ini_handler handler, void *user)
| Same as ini_parse(), but takes a FILE* instead of filename. This doesn't close the file when it's finished – the caller must do that.
int | ini_parse_stream (ini_reader reader, void *stream, ini_handler handler, void *user)
| Same as ini_parse(), but takes an ini_reader function pointer instead of filename. Used for implementing custom or string-based I/O.
EXIV2API Image::AutoPtr | newJp2Instance (BasicIo::AutoPtr io, bool create)
| Create a new Jp2Image instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isJp2Type (BasicIo &iIo, bool advance)
| Check if the file iIo is a JPEG-2000 image.
EXIV2API Image::AutoPtr | newJpegInstance (BasicIo::AutoPtr io, bool create)
| Create a new JpegImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isJpegType (BasicIo &iIo, bool advance)
| Check if the file iIo is a JPEG image.
EXIV2API Image::AutoPtr | newExvInstance (BasicIo::AutoPtr io, bool create)
| Create a new ExvImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isExvType (BasicIo &iIo, bool advance)
| Check if the file iIo is an EXV file.
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr | newMkvInstance (BasicIo::AutoPtr io, bool create)
| Create a new MatroskaVideo instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2LIB_DEPRECATED_EXPORT bool | isMkvType (BasicIo &iIo, bool advance)
| Check if the file iIo is a Matroska Video.
std::ostream & | operator<< (std::ostream &os, const Key &key)
| Output operator for Key types.
std::ostream & | operator<< (std::ostream &os, const Metadatum &md)
| Output operator for Metadatum types, writing the interpreted tag value.
EXIV2API bool | cmpMetadataByTag (const Metadatum &lhs, const Metadatum &rhs)
| Compare two metadata by tag. Return true if the tag of metadatum lhs is less than that of rhs.
EXIV2API bool | cmpMetadataByKey (const Metadatum &lhs, const Metadatum &rhs)
| Compare two metadata by key. Return true if the key of metadatum lhs is less than that of rhs.
EXIV2API Image::AutoPtr | newMrwInstance (BasicIo::AutoPtr io, bool create)
| Create a new MrwImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isMrwType (BasicIo &iIo, bool advance)
| Check if the file iIo is a MRW image.
EXIV2API Image::AutoPtr | newOrfInstance (BasicIo::AutoPtr io, bool create)
| Create a new OrfImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isOrfType (BasicIo &iIo, bool advance)
| Check if the file iIo is an ORF image.
EXIV2API Image::AutoPtr | newPgfInstance (BasicIo::AutoPtr io, bool create)
| Create a new PgfImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isPgfType (BasicIo &iIo, bool advance)
| Check if the file iIo is a PGF image.
EXIV2API Image::AutoPtr | newPngInstance (BasicIo::AutoPtr io, bool create)
| Create a new PngImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isPngType (BasicIo &iIo, bool advance)
| Check if the file iIo is a PNG image.
EXIV2API std::ostream & | operator<< (std::ostream &os, const XmpPropertyInfo &propertyInfo)
| Output operator for property info.
EXIV2API Image::AutoPtr | newPsdInstance (BasicIo::AutoPtr io, bool create)
| Create a new PsdImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isPsdType (BasicIo &iIo, bool advance)
| Check if the file iIo is a Photoshop image.
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr | newQTimeInstance (BasicIo::AutoPtr io, bool create)
| Create a new QuicktimeVideo instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2LIB_DEPRECATED_EXPORT bool | isQTimeType (BasicIo &iIo, bool advance)
| Check if the file iIo is a Quick Time Video.
EXIV2API Image::AutoPtr | newRafInstance (BasicIo::AutoPtr io, bool create)
| Create a new RafImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isRafType (BasicIo &iIo, bool advance)
| Check if the file iIo is a RAF image.
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr | newRiffInstance (BasicIo::AutoPtr io, bool create)
| Create a new RiffVideo instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2LIB_DEPRECATED_EXPORT bool | isRiffType (BasicIo &iIo, bool advance)
| Check if the file iIo is a Riff Video.
EXIV2API Image::AutoPtr | newRw2Instance (BasicIo::AutoPtr io, bool create)
| Create a new Rw2Image instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isRw2Type (BasicIo &iIo, bool advance)
| Check if the file iIo is a RW2 image.
template<typename T >
Slice< T > | makeSlice (T &cont, size_t begin, size_t end)
| Return a new slice with the given bounds.
template<typename T >
Slice< T * > | makeSlice (T *ptr, size_t begin, size_t end)
template<typename container >
Slice< container > | makeSlice (container &cont)
| Return a new slice spanning the whole container.
template<typename container >
Slice< container > | makeSliceFrom (container &cont, size_t begin)
| Return a new slice spanning from begin until the end of the container.
template<typename container >
Slice< container > | makeSliceUntil (container &cont, size_t end)
| Return a new slice spanning until `end`.
template<typename T >
Slice< T * > | makeSliceUntil (T *ptr, size_t end)
EXIV2API std::ostream & | operator<< (std::ostream &os, const TagInfo &ti)
| Output operator for TagInfo.
EXIV2API Image::AutoPtr | newTgaInstance (BasicIo::AutoPtr io, bool create)
| Create a new TgaImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isTgaType (BasicIo &iIo, bool advance)
| Check if the file iIo is a Targa v2 image.
EXIV2API Image::AutoPtr | newTiffInstance (BasicIo::AutoPtr io, bool create)
| Create a new TiffImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isTiffType (BasicIo &iIo, bool advance)
| Check if the file iIo is a TIFF image.
EXIV2API Slice< byte * > | makeSlice (DataBuf &buf, size_t begin, size_t end)
| Create a new Slice from a DataBuf given the bounds.
EXIV2API Slice< const byte * > | makeSlice (const DataBuf &buf, size_t begin, size_t end)
| Overload of makeSlice for `const DataBuf`, returning an immutable Slice.
EXIV2API uint16_t | getUShort (const byte *buf, ByteOrder byteOrder)
| Read a 2 byte unsigned short value from the data buffer.
template<typename T >
uint16_t | getUShort (const Slice< T > &buf, ByteOrder byteOrder)
| Read a 2 byte unsigned short value from a Slice.
EXIV2API uint32_t | getULong (const byte *buf, ByteOrder byteOrder)
| Read a 4 byte unsigned long value from the data buffer.
EXIV2API uint64_t | getULongLong (const byte *buf, ByteOrder byteOrder)
| Read a 8 byte unsigned long value from the data buffer.
EXIV2API URational | getURational (const byte *buf, ByteOrder byteOrder)
| Read an 8 byte unsigned rational value from the data buffer.
EXIV2API int16_t | getShort (const byte *buf, ByteOrder byteOrder)
| Read a 2 byte signed short value from the data buffer.
EXIV2API int32_t | getLong (const byte *buf, ByteOrder byteOrder)
| Read a 4 byte signed long value from the data buffer.
EXIV2API Rational | getRational (const byte *buf, ByteOrder byteOrder)
| Read an 8 byte signed rational value from the data buffer.
EXIV2API float | getFloat (const byte *buf, ByteOrder byteOrder)
| Read a 4 byte single precision floating point value (IEEE 754 binary32) from the data buffer.
EXIV2API double | getDouble (const byte *buf, ByteOrder byteOrder)
| Read an 8 byte double precision floating point value (IEEE 754 binary64) from the data buffer.
EXIV2API std::ostream & | operator<< (std::ostream &os, const Rational &r)
| Output operator for our fake rational.
EXIV2API std::istream & | operator>> (std::istream &is, Rational &r)
| Input operator for our fake rational.
EXIV2API std::ostream & | operator<< (std::ostream &os, const URational &r)
| Output operator for our fake unsigned rational.
EXIV2API std::istream & | operator>> (std::istream &is, URational &r)
| Input operator for our fake unsigned rational.
EXIV2API long | us2Data (byte *buf, uint16_t s, ByteOrder byteOrder)
| Convert an unsigned short to data, write the data to the buffer, return number of bytes written.
EXIV2API long | ul2Data (byte *buf, uint32_t l, ByteOrder byteOrder)
| Convert an unsigned long to data, write the data to the buffer, return number of bytes written.
EXIV2API long | ur2Data (byte *buf, URational l, ByteOrder byteOrder)
| Convert an unsigned rational to data, write the data to the buffer, return number of bytes written.
EXIV2API long | s2Data (byte *buf, int16_t s, ByteOrder byteOrder)
| Convert a signed short to data, write the data to the buffer, return number of bytes written.
EXIV2API long | l2Data (byte *buf, int32_t l, ByteOrder byteOrder)
| Convert a signed long to data, write the data to the buffer, return number of bytes written.
EXIV2API long | r2Data (byte *buf, Rational l, ByteOrder byteOrder)
| Convert a signed rational to data, write the data to the buffer, return number of bytes written.
EXIV2API long | f2Data (byte *buf, float f, ByteOrder byteOrder)
| Convert a single precision floating point (IEEE 754 binary32) float to data, write the data to the buffer, return number of bytes written.
EXIV2API long | d2Data (byte *buf, double d, ByteOrder byteOrder)
| Convert a double precision floating point (IEEE 754 binary64) double to data, write the data to the buffer, return number of bytes written.
EXIV2API void | hexdump (std::ostream &os, const byte *buf, long len, long offset=0)
| Print len bytes from buf in hex and ASCII format to the given stream, prefixed with the position in the buffer adjusted by offset.
EXIV2API bool | isHex (const std::string &str, size_t size=0, const std::string &prefix="")
| Return true if str is a hex number starting with prefix followed by size hex digits, false otherwise. If size is 0, any number of digits is allowed and all are checked.
EXIV2API int | exifTime (const char *buf, struct tm *tm)
| Converts a string in the form "%Y:%m:%d %H:%M:%S", e.g., "2007:05:24 12:31:55" to broken down time format, returns 0 if successful, else 1.
EXIV2API const char * | exvGettext (const char *str)
| Translate a string using the gettext framework. This wrapper hides all the implementation details from the interface.
EXIV2API long | parseLong (const std::string &s, bool &ok)
| Return a long set to the value represented by s.
EXIV2API float | parseFloat (const std::string &s, bool &ok)
| Return a float set to the value represented by s.
EXIV2API Rational | parseRational (const std::string &s, bool &ok)
| Return a Rational set to the value represented by s.
EXIV2API Rational | floatToRationalCast (float f)
| Very simple conversion of a float to a Rational.
template<typename T , typename K , int N>
const T * | find (T(&src)[N], const K &key)
| Find an element that matches key in the array src.
template<typename T , int N>
char(& | sizer (T(&)[N]))[N]
| Template used in the COUNTOF macro to determine the size of an array.
template<typename T >
std::string | toString (const T &arg)
| Utility function to convert the argument of any type to a string.
template<typename T >
T | stringTo (const std::string &s, bool &ok)
| Utility function to convert a string to a value of type `T`.
template<>
bool | stringTo< bool > (const std::string &s, bool &ok)
| Specialization of stringTo(const std::string& s, bool& ok) for bool.
template<typename IntType >
IntType | gcd (IntType n, IntType m)
| Return the greatest common denominator of n and m. (Implementation from Boost rational.hpp)
std::ostream & | operator<< (std::ostream &os, const Value &value)
| Output operator for Value types.
template<typename T >
TypeId | getType ()
| Template to determine the TypeId for a type T.
template<>
TypeId | getType< uint16_t > ()
| Specialization for an unsigned short.
template<>
TypeId | getType< uint32_t > ()
| Specialization for an unsigned long.
template<>
TypeId | getType< URational > ()
| Specialization for an unsigned rational.
template<>
TypeId | getType< int16_t > ()
| Specialization for a signed short.
template<>
TypeId | getType< int32_t > ()
| Specialization for a signed long.
template<>
TypeId | getType< Rational > ()
| Specialization for a signed rational.
template<>
TypeId | getType< float > ()
| Specialization for a float.
template<>
TypeId | getType< double > ()
| Specialization for a double.
template<typename T >
T | getValue (const byte *buf, ByteOrder byteOrder)
| Read a value of type T from the data buffer.
template<>
uint16_t | getValue (const byte *buf, ByteOrder byteOrder)
template<>
uint32_t | getValue (const byte *buf, ByteOrder byteOrder)
template<>
URational | getValue (const byte *buf, ByteOrder byteOrder)
template<>
int16_t | getValue (const byte *buf, ByteOrder byteOrder)
template<>
int32_t | getValue (const byte *buf, ByteOrder byteOrder)
template<>
Rational | getValue (const byte *buf, ByteOrder byteOrder)
template<>
float | getValue (const byte *buf, ByteOrder byteOrder)
template<>
double | getValue (const byte *buf, ByteOrder byteOrder)
template<typename T >
long | toData (byte *buf, T t, ByteOrder byteOrder)
| Convert a value of type T to data, write the data to the data buffer.
template<>
long | toData (byte *buf, uint16_t t, ByteOrder byteOrder)
| Specialization to write an unsigned short to the data buffer. Return the number of bytes written.
template<>
long | toData (byte *buf, uint32_t t, ByteOrder byteOrder)
| Specialization to write an unsigned long to the data buffer. Return the number of bytes written.
template<>
long | toData (byte *buf, URational t, ByteOrder byteOrder)
| Specialization to write an unsigned rational to the data buffer. Return the number of bytes written.
template<>
long | toData (byte *buf, int16_t t, ByteOrder byteOrder)
| Specialization to write a signed short to the data buffer. Return the number of bytes written.
template<>
long | toData (byte *buf, int32_t t, ByteOrder byteOrder)
| Specialization to write a signed long to the data buffer. Return the number of bytes written.
template<>
long | toData (byte *buf, Rational t, ByteOrder byteOrder)
| Specialization to write a signed rational to the data buffer. Return the number of bytes written.
template<>
long | toData (byte *buf, float t, ByteOrder byteOrder)
| Specialization to write a float to the data buffer. Return the number of bytes written.
template<>
long | toData (byte *buf, double t, ByteOrder byteOrder)
| Specialization to write a double to the data buffer. Return the number of bytes written.
EXIV2API int | versionNumber ()
| Return the version of Exiv2 available at runtime as an integer.
EXIV2API std::string | versionString ()
| Return the version string Example: "0.25.0" (major.minor.patch)
EXIV2API std::string | versionNumberHexString ()
| Return the version of Exiv2 as hex string of fixed length 6.
EXIV2API const char * | version ()
| Return the version of Exiv2 as "C" string eg "0.27.0.2".
EXIV2API bool | testVersion (int major, int minor, int patch)
| Test the version of the available Exiv2 library at runtime. Return true if it is the same as or newer than the passed-in version.
EXIV2API void | dumpLibraryInfo (std::ostream &os, const exv_grep_keys_t &keys)
| dumpLibraryInfo implements the exiv2 option –version –verbose used by exiv2 test suite to inspect libraries loaded at run-time
EXIV2API Image::AutoPtr | newWebPInstance (BasicIo::AutoPtr io, bool create)
| Create a new WebPImage instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isWebPType (BasicIo &iIo, bool advance)
| Check if the file iIo is a WebP Video.
EXIV2API Image::AutoPtr | newXmpInstance (BasicIo::AutoPtr io, bool create)
| Create a new XmpSidecar instance and return an auto-pointer to it. Caller owns the returned object and the auto-pointer ensures that it will be deleted.
EXIV2API bool | isXmpType (BasicIo &iIo, bool advance)
| Check if the file iIo is an XMP sidecar file.
template<typename T >
Exiv2::Exifdatum & | setValue (Exiv2::Exifdatum &exifDatum, const T &value)
| Set the value of exifDatum to value. If the object already has a value, it is replaced. Otherwise a new ValueType<T> value is created and set to value.
char | to_hex (char code)
| Convert an integer value to its hex character.
char | from_hex (char ch)
| Convert a hex character to its integer value.
template<>
bool | stringTo< bool > (const std::string &s, bool &ok)
| Specialization of stringTo(const std::string& s, bool& ok) for bool.

## Variables

const char * | ENVARDEF [] = {"/exiv2.php", "40"}
| default URL for http exiv2 handler and time-out
const char * | ENVARKEY [] = {"EXIV2_HTTP_POST", "EXIV2_TIMEOUT"}
| request keys for http exiv2 handler and time-out
const SectionInfo | sectionInfo []
| List of all defined Exif sections.
MimeTypeList | mimeTypeList []
| List of TIFF compression to MIME type mappings.

## Detailed Description

Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of the objects of this namespace.

## Enumeration Type Documentation

## ErrorCode

enum Exiv2::ErrorCode

Complete list of all Exiv2 error codes.

Enumerator
kerValueTooLarge | Entry::setValue: Value too large.
kerDataAreaValueTooLarge | Entry::setDataArea: Value too large.

## TypeId

enum Exiv2::TypeId

Exiv2 value type identifiers.

Used primarily as identifiers when creating Exiv2 Value instances. See Value::create. 0x0000 to 0xffff are reserved for TIFF (Exif) types.

Enumerator
unsignedByte | Exif BYTE type, 8-bit unsigned integer.
asciiString | Exif ASCII type, 8-bit byte.
unsignedShort | Exif SHORT type, 16-bit (2-byte) unsigned integer.
unsignedLong | Exif LONG type, 32-bit (4-byte) unsigned integer.
unsignedRational | Exif RATIONAL type, two LONGs: numerator and denumerator of a fraction.
signedByte | Exif SBYTE type, an 8-bit signed (twos-complement) integer.
undefined | Exif UNDEFINED type, an 8-bit byte that may contain anything.
signedShort | Exif SSHORT type, a 16-bit (2-byte) signed (twos-complement) integer.
signedLong | Exif SLONG type, a 32-bit (4-byte) signed (twos-complement) integer.
signedRational | Exif SRATIONAL type, two SLONGs: numerator and denumerator of a fraction.
tiffFloat | TIFF FLOAT type, single precision (4-byte) IEEE format.
tiffDouble | TIFF DOUBLE type, double precision (8-byte) IEEE format.
tiffIfd | TIFF IFD type, 32-bit (4-byte) unsigned integer.
unsignedLongLong | Exif LONG LONG type, 64-bit (8-byte) unsigned integer.
signedLongLong | Exif LONG LONG type, 64-bit (8-byte) signed integer.
tiffIfd8 | TIFF IFD type, 64-bit (8-byte) unsigned integer.
string | IPTC string type.
date | IPTC date type.
time | IPTC time type.
comment | Exiv2 type for the Exif user comment.
directory | Exiv2 type for a CIFF directory.
xmpText | XMP text type.
xmpAlt | XMP alternative type.
xmpBag | XMP bag type.
xmpSeq | XMP sequence type.
langAlt | XMP language alternative type.
invalidTypeId | Invalid type id.
lastTypeId | Last type id.

## Function Documentation

## base64decode()

long Exiv2::base64decode | ( | const char * | in,
|  | char * | out,
|  | size_t | out_size
| ) |  |

Decode base64 data and put the resulting string in out.

Parameters

  in | The data need to decode.
  out | The container for the result, it should be large enough to contain the result.
  out_size | The size of out in bytes.

Returns
  the size of the resulting string. If it fails, return -1.

Note
  Source: https://github.com/davidgaleano/libwebsockets/blob/master/lib/base64-decode.c

Referenced by Exiv2::XPathIo::writeDataToFile().

## base64encode()

int Exiv2::base64encode | ( | const void * | data_buf,
|  | size_t | dataLength,
|  | char * | result,
|  | size_t | resultSize
| ) |  |

Encode in base64 the data in data_buf and put the resulting string in result.

Parameters

  data_buf | The data need to encode
  dataLength | Size in bytes of the in buffer
  result | The container for the result, NULL if it fails
  resultSize | Size in bytes of the out string, it should be at least ((dataLength + 2) / 3) * 4 + 1

Returns
  1 indicate success

Note
  Source: http://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64

Referenced by Exiv2::HttpIo::HttpImpl::writeRemote().

## convertStringCharset()

bool Exiv2::convertStringCharset | ( | std::string & | str,
|  | const char * | from,
|  | const char * | to
| ) |  |

Convert character encoding of str from from to to. If the function succeeds, str contains the result string.

This function uses the iconv library, if the Exiv2 library was compiled with iconv support. Otherwise, on Windows, it uses Windows functions to support a limited number of conversions and fails with a warning if an unsupported conversion is attempted. If the function is called but Exiv2 was not compiled with iconv support and can't use Windows functions, it fails with a warning.

The conversions supported on Windows without iconv are:

from | to
UTF-8 | UCS-2BE
UTF-8 | UCS-2LE
UCS-2BE | UTF-8
UCS-2BE | UCS-2LE
UCS-2LE | UTF-8
UCS-2LE | UCS-2BE
ISO-8859-1 | UTF-8
ASCII | UTF-8

Parameters

  str | The string to convert. It is updated to the converted string, which may have a different size. If the function call fails, the string is not modified.
  from | Charset in which the input string is encoded as a name understood by `iconv_open(3)`.
  to | Charset to convert the string to as a name understood by `iconv_open(3)`.

Returns
  Return `true` if the conversion was successful, else `false`.

References EXV_WARNING.

Referenced by Exiv2::Converter::cnvIptcValue(), Exiv2::CommentValue::comment(), Exiv2::CommentValue::copy(), Exiv2::Internal::printUcs2(), and Exiv2::CommentValue::read().

## fileExists()

bool Exiv2::fileExists | ( | const std::string & | path,
|  | bool | ct = `false`
| ) |  |

Test if a file exists.

Parameters

  path | Name of file to verify.
  ct | Flag to check if path is a regular file.

Returns
  true if path exists and, if ct is set, is a regular file, else false.

Note
  The function calls stat() test for path and its type, see stat(2). errno is left unchanged in case of an error.

References fileProtocol().

Referenced by Exiv2::FileIo::transfer().

## fileProtocol()

Protocol Exiv2::fileProtocol | ( | const std::string & | path | ) |

Return the protocol of the path.

Parameters

  path | The path of file to extract the protocol.

Returns
  the protocol of the path.

Referenced by Exiv2::ImageFactory::createIo(), fileExists(), and Exiv2::XPathIo::writeDataToFile().

## find()

template<typename T , typename K , int N>

const T * Exiv2::find | ( | T(&) | src[N],
|  | const K & | key
| ) |  |

Find an element that matches key in the array src.

Designed to be used with lookup tables as shown in the example below. Requires a Key structure (ideally in the array) and a comparison operator to compare a key with an array element. The size of the array is determined automagically. Thanks to Stephan Broennimann for this nifty implementation.

struct Bar {
int i;
int k;
const char* data;
struct Key;
bool operator==(const Bar::Key& rhs) const;
};
struct Bar::Key {
Key(int a, int b) : i(a), k(b) {}
int i;
int k;
};
bool Bar::operator==(const Bar::Key& key) const // definition
{
return i == key.i && k == key.k;
}
const Bar bars[] = {
{ 1, 1, "bar data 1" },
{ 1, 2, "bar data 2" },
{ 1, 3, "bar data 3" }
};
int main ( void ) {
const Bar* bar = find(bars, Bar::Key(1, 3));
if (bar) std::cout << bar->data << "\n";
else std::cout << "Key not found.\n";
return 0;
}
Exiv2::Key
Abstract base class defining the Key of a metadatum. Keys are used to identify and group metadata.
Definition metadatum.hpp:44
Exiv2::Internal::operator==
bool operator==(const TagDetails &td, const LensTypeAndFocalLengthAndMaxAperture &ltfl)
Compare tag details with a lens entry.
Definition canonmn_int.cpp:2820
Exiv2::find
const T * find(T(&src)[N], const K &key)
Find an element that matches key in the array src.
Definition types.hpp:497

Referenced by Exiv2::ImageFactory::checkMode(), Exiv2::ImageFactory::checkType(), Exiv2::ImageFactory::create(), Exiv2::Internal::TiffMnCreator::create(), Exiv2::Internal::TiffMnCreator::create(), Exiv2::Internal::TiffCreator::create(), errMsg(), Exiv2::Internal::TiffMapping::findDecoder(), Exiv2::Internal::TiffMapping::findEncoder(), Exiv2::Internal::TiffCreator::getPath(), Exiv2::Internal::groupId(), Exiv2::Internal::groupName(), Exiv2::Internal::ifdName(), Exiv2::Internal::isMakerIfd(), Exiv2::Internal::isTiffImageTag(), Exiv2::TiffImage::mimeType(), Exiv2::Internal::nikonCrypt(), Exiv2::Internal::nikonSelector(), Exiv2::Internal::Nikon3MakerNote::print0x009e(), Exiv2::Internal::printCombiTag(), Exiv2::Internal::printCsLensByFocalLength(), Exiv2::Internal::printCsLensByFocalLengthAndMaxAperture(), Exiv2::Internal::printCsLensByFocalLengthTC(), Exiv2::Internal::CanonMakerNote::printCsLensType(), Exiv2::Internal::printLensType(), Exiv2::Internal::printMinoltaSonyLensID(), Exiv2::Internal::printTag(), Exiv2::Internal::printTagVocabulary(), Exiv2::Internal::resolveLens0x319(), Exiv2::Internal::resolveLens0x32c(), Exiv2::Internal::resolveLens0x3ff(), Exiv2::Internal::resolveLens0x8ff(), Exiv2::Internal::tagList(), Exiv2::TypeInfo::typeId(), Exiv2::TypeInfo::typeName(), and Exiv2::TypeInfo::typeSize().

## floatToRationalCast()

Rational Exiv2::floatToRationalCast | ( | float | f | ) |

Very simple conversion of a float to a Rational.

Test it with the values that you expect and check the implementation to see if this is really what you want!

References Safe::abs(), and gcd().

Referenced by Exiv2::Converter::cnvXmpGPSCoord(), operator>>(), operator>>(), parseRational(), and Exiv2::ValueType< T >::toRational().

## gcd()

template<typename IntType >

IntType Exiv2::gcd | ( | IntType | n,
|  | IntType | m
| ) |  |

Return the greatest common denominator of n and m. (Implementation from Boost rational.hpp)

Note
  We use n and m as temporaries in this function, so there is no value in using const IntType& as we would only need to make a copy anyway...

Referenced by floatToRationalCast(), and Exiv2::Internal::print0x9204().

## getEnv()

std::string Exiv2::getEnv | ( | int | env_var | ) |

Return the value of environmental variable.

Parameters

  [in] | var | The name of environmental variable. Must be a member of the enumeration EnVar.

Returns
  the value of environmental variable. If it's empty, the default value is returned.

Exceptions

  std::out_of_range | when an unexpected EnVar is given as input.

References ENVARDEF, and ENVARKEY.

Referenced by Exiv2::HttpIo::HttpImpl::writeRemote().

## getValue()

template<typename T >

T Exiv2::getValue | ( | const byte * | buf,
|  | ByteOrder | byteOrder
| ) |  |

Read a value of type T from the data buffer.

We need this template function for the ValueType template classes. There are only specializations of this function available; no default implementation is provided.

Parameters

  buf | Pointer to the data buffer to read from.
  byteOrder | Applicable byte order (little or big endian).

Returns
  A value of type T.

## http()

int Exiv2::http | ( | Exiv2::Dictionary & | request,
|  | Exiv2::Dictionary & | response,
|  | std::string & | errors
| ) |  |

execute an HTTP request

Parameters

  request | - a Dictionary of headers to send to server
  response | - a Dictionary of response headers (dictionary is filled by the response)
  errors | - a String with an error

Returns
  Server response 200 = OK, 404 = Not Found etc...

References Exiv2::Uri::Host, Exiv2::Uri::Parse(), Exiv2::Uri::Port, and version().

Referenced by Exiv2::HttpIo::HttpImpl::getDataByRange(), Exiv2::HttpIo::HttpImpl::getFileLength(), and Exiv2::HttpIo::HttpImpl::writeRemote().

## ini_parse()

int Exiv2::ini_parse | ( | const char * | filename,
|  | ini_handler | handler,
|  | void * | user
| ) |  |

Parse given INI-style file. May have [section]s, name=value pairs (whitespace stripped), and comments starting with ';' (semicolon). Section is "" if name=value pair parsed before any section heading. name:value pairs are also supported as a concession to Python's configparser.

For each name=value pair parsed, call handler function with given user pointer as well as section, name, and value (data only valid for duration of handler call). Handler should return nonzero on success, zero on error.

Parameters

  filename | path to file
  handler | user defined handler
  user | void pointer passed to user handler

Returns
  0 on success, line number of first error on parse error (doesn't stop on first error), -1 on file open error, or -2 on memory allocation error (only when INI_USE_STACK is zero).
  0 on success

References ini_parse_file().

Referenced by Exiv2::INIReader::INIReader().

## ini_parse_file()

int Exiv2::ini_parse_file | ( | FILE * | file,
|  | ini_handler | handler,
|  | void * | user
| ) |  |

Same as ini_parse(), but takes a FILE* instead of filename. This doesn't close the file when it's finished – the caller must do that.

Parameters

  file | open "C" file
  handler | user defined handler
  user | void pointer passed to user handler

References ini_parse_stream().

Referenced by ini_parse().

## ini_parse_stream()

int Exiv2::ini_parse_stream | ( | ini_reader | reader,
|  | void * | stream,
|  | ini_handler | handler,
|  | void * | user
| ) |  |

Same as ini_parse(), but takes an ini_reader function pointer instead of filename. Used for implementing custom or string-based I/O.

Parameters

  reader | magic
  stream | more magic
  handler | user defined handler
  user | void pointer passed to user handler

Returns
  0 on success

Referenced by ini_parse_file().

## makeSlice() [1/3]

Slice< byte * > Exiv2::makeSlice | ( | DataBuf & | buf,
|  | size_t | begin,
|  | size_t | end
| ) |  |

Create a new Slice from a DataBuf given the bounds.

Parameters

  [in] | begin,end | Bounds of the new Slice. `begin` must be smaller than `end` and both must not be larger than LONG_MAX.
  [in] | buf | The DataBuf from which' data the Slice will be constructed

Exceptions

  std::invalid_argument | when `end` is larger than `LONG_MAX` or anything that the constructor of Slice throws

References Exiv2::DataBuf::pData_.

## makeSlice() [2/3]

template<typename T >

Slice< T > Exiv2::makeSlice | ( | T & | cont,
|  | size_t | begin,
|  | size_t | end
| ) |  |

inline

Return a new slice with the given bounds.

Convenience wrapper around the slice's constructor for automatic template parameter deduction.

Referenced by Exiv2::Image::printIFDStructure(), Exiv2::IptcData::printStructure(), Exiv2::Jp2Image::printStructure(), Exiv2::JpegBase::printStructure(), Exiv2::RafImage::printStructure(), and Exiv2::WebPImage::printStructure().

## makeSlice() [3/3]

template<typename T >

Slice< T * > Exiv2::makeSlice | ( | T * | ptr,
|  | size_t | begin,
|  | size_t | end
| ) |  |

inline

Overload of makeSlice for slices of C-arrays.

## makeSliceUntil()

template<typename T >

Slice< T * > Exiv2::makeSliceUntil | ( | T * | ptr,
|  | size_t | end
| ) |  |

inline

Overload of makeSliceUntil for pointer based slices.

## operator>>()

std::istream & Exiv2::operator>> | ( | std::istream & | is,
|  | URational & | r
| ) |  |

Input operator for our fake unsigned rational.

References floatToRationalCast().

## parseFloat()

float Exiv2::parseFloat | ( | const std::string & | s,
|  | bool & | ok
| ) |  |

Return a float set to the value represented by s.

Besides strings that represent float values, the function also handles long, Rational and boolean (see also: stringTo(const std::string& s, bool& ok)).

Parameters

  s | String to parse
  ok | Output variable indicating the success of the operation.

Returns
  Returns the float value represented by s and sets ok to `true` if the conversion was successful or `false` if not.

References stringTo< bool >().

Referenced by Exiv2::XmpTextValue::toFloat(), and Exiv2::XmpArrayValue::toFloat().

## parseLong()

long Exiv2::parseLong | ( | const std::string & | s,
|  | bool & | ok
| ) |  |

Return a long set to the value represented by s.

Besides strings that represent long values, the function also handles float, Rational and boolean (see also: stringTo(const std::string& s, bool& ok)).

Parameters

  s | String to parse
  ok | Output variable indicating the success of the operation.

Returns
  Returns the long value represented by s and sets ok to `true` if the conversion was successful or `false` if not.

References stringTo< bool >().

Referenced by isoSpeed(), Exiv2::XmpTextValue::toLong(), and Exiv2::XmpArrayValue::toLong().

## parseRational()

Rational Exiv2::parseRational | ( | const std::string & | s,
|  | bool & | ok
| ) |  |

Return a Rational set to the value represented by s.

Besides strings that represent Rational values, the function also handles long, float and boolean (see also: stringTo(const std::string& s, bool& ok)). Uses floatToRationalCast(float f) if the string can be parsed into a float.

Parameters

  s | String to parse
  ok | Output variable indicating the success of the operation.

Returns
  Returns the Rational value represented by s and sets ok to `true` if the conversion was successful or `false` if not.

References floatToRationalCast(), and stringTo< bool >().

Referenced by Exiv2::XmpTextValue::toRational(), and Exiv2::XmpArrayValue::toRational().

## pathOfFileUrl()

std::string Exiv2::pathOfFileUrl | ( | const std::string & | url | ) |

Get the path of file URL.

Parameters

  url | The file URL in the format file:///path or file://host/path

Returns
  the path of file URL.

Referenced by Exiv2::ImageFactory::createIo().

## readFile()

DataBuf Exiv2::readFile | ( | const std::string & | path | ) |

Read file path into a DataBuf, which is returned.

Returns
  Buffer containing the file.

Exceptions

  Error | In case of failure.

Examples
  xmpparse.cpp.

References Exiv2::FileIo::open(), Exiv2::DataBuf::pData_, Exiv2::FileIo::read(), Exiv2::DataBuf::size_, and strError().

Referenced by Exiv2::ExifThumb::setJpegThumbnail(), and Exiv2::ExifThumb::setJpegThumbnail().

## ReplaceStringInPlace()

std::string Exiv2::ReplaceStringInPlace | ( | std::string | subject,
|  | const std::string & | search,
|  | const std::string & | replace
| ) |  |

replace each substring of the subject that matches the given search string with the given replacement.

Returns
  the subject after replacing.

Referenced by Exiv2::XPathIo::transfer().

## setValue()

template<typename T >

Exiv2::Exifdatum & Exiv2::setValue | ( | Exiv2::Exifdatum & | exifDatum,
|  | const T & | value
| ) |  |

Set the value of exifDatum to value. If the object already has a value, it is replaced. Otherwise a new ValueType<T> value is created and set to value.

This is a helper function, called from Exifdatum members. It is meant to be used with T = (u)int16_t, (u)int32_t or (U)Rational. Do not use directly.

Referenced by Exiv2::Exifdatum::operator=(), Exiv2::Exifdatum::operator=(), Exiv2::Exifdatum::operator=(), Exiv2::Exifdatum::operator=(), Exiv2::Exifdatum::operator=(), and Exiv2::Exifdatum::operator=().

## stringTo()

template<typename T >

T Exiv2::stringTo | ( | const std::string & | s,
|  | bool & | ok
| ) |  |

Utility function to convert a string to a value of type `T`.

The string representation of the value must match that recognized by the input operator for `T` for this function to succeed.

Parameters

  s | String to convert
  ok | Output variable indicating the success of the operation.

Returns
  Returns the converted value and sets ok to `true` if the conversion was successful or `false` if not.

## stringTo< bool >() [1/2]

template<>

bool Exiv2::stringTo< bool > | ( | const std::string & | s,
|  | bool & | ok
| ) |  |

Specialization of stringTo(const std::string& s, bool& ok) for bool.

Handles the same string values as the XMP SDK. Converts the string to lowercase and returns `true` if it is "true", "t" or "1", and `false` if it is "false", "f" or "0".

Referenced by parseFloat(), parseLong(), and parseRational().

## stringTo< bool >() [2/2]

template<>

bool Exiv2::stringTo< bool > | ( | const std::string & | s,
|  | bool & | ok
| ) |  |

Specialization of stringTo(const std::string& s, bool& ok) for bool.

Handles the same string values as the XMP SDK. Converts the string to lowercase and returns `true` if it is "true", "t" or "1", and `false` if it is "false", "f" or "0".

Referenced by parseFloat(), parseLong(), and parseRational().

## testVersion()

bool Exiv2::testVersion | ( | int | major,
|  | int | minor,
|  | int | patch
| ) |  |

Test the version of the available Exiv2 library at runtime. Return true if it is the same as or newer than the passed-in version.

Versions are denoted using a triplet of integers: major.minor.patch . The fourth version number is designated a "tweak" an used by Release Candidates

Examples
  exifprint.cpp.

References versionNumber().

## toData()

template<typename T >

long Exiv2::toData | ( | byte * | buf,
|  | T | t,
|  | ByteOrder | byteOrder
| ) |  |

Convert a value of type T to data, write the data to the data buffer.

We need this template function for the ValueType template classes. There are only specializations of this function available; no default implementation is provided.

Parameters

  buf | Pointer to the data buffer to write to.
  t | Value to be converted.
  byteOrder | Applicable byte order (little or big endian).

Returns
  The number of bytes written to the buffer.

Referenced by Exiv2::ValueType< T >::copy().

## urldecode() [1/2]

char * Exiv2::urldecode | ( | const char * | str | ) |

Decode the input url.

Parameters

  str | The url needs decoding.

Returns
  the url-decoded version of str.

Note
  Be sure to 'free' the returned string after use with 'delete []'. Source: http://www.geekhideout.com/urlcode.shtml

References from_hex().

Referenced by Exiv2::Uri::Decode(), and urldecode().

## urldecode() [2/2]

void Exiv2::urldecode | ( | std::string & | str | ) |

Like urlencode(char* str) but accept the input url in the std::string and modify it.

References urldecode().

## urlencode()

std::string Exiv2::urlencode | ( | const char * | str | ) |

Encode the input url.

Parameters

  str | The url needs encoding.

Returns
  the url-encoded version of str.

Note
  Source: http://www.geekhideout.com/urlcode.shtml

References to_hex().

Referenced by Exiv2::HttpIo::HttpImpl::writeRemote().

## writeFile()

long Exiv2::writeFile | ( | const DataBuf & | buf,
|  | const std::string & | path
| ) |  |

Write DataBuf buf to file path.

Returns
  Return the number of bytes written.

Exceptions

  Error | In case of failure.

References Exiv2::FileIo::open(), Exiv2::DataBuf::pData_, Exiv2::DataBuf::size_, strError(), and Exiv2::FileIo::write().

Referenced by Exiv2::ExifThumbC::writeFile(), and Exiv2::PreviewImage::writeFile().

## Variable Documentation

## mimeTypeList

MimeTypeList Exiv2::mimeTypeList[]

Initial value:
= {
{ 32767, "image/x-sony-arw" },
{ 32769, "image/x-epson-erf" },
{ 32770, "image/x-samsung-srw" },
{ 34713, "image/x-nikon-nef" },
{ 65000, "image/x-kodak-dcr" },
{ 65535, "image/x-pentax-pef" }
}

List of TIFF compression to MIME type mappings.

Referenced by Exiv2::TiffImage::mimeType().

## sectionInfo

const SectionInfo Exiv2::sectionInfo[]

extern

Initial value:
= {
{ sectionIdNotSet, "(UnknownSection)", N_("Unknown section") },
{ imgStruct, "ImageStructure", N_("Image data structure") },
{ recOffset, "RecordingOffset", N_("Recording offset") },
{ imgCharacter, "ImageCharacteristics", N_("Image data characteristics") },
{ otherTags, "OtherTags", N_("Other data") },
{ exifFormat, "ExifFormat", N_("Exif data structure") },
{ exifVersion, "ExifVersion", N_("Exif version") },
{ imgConfig, "ImageConfig", N_("Image configuration") },
{ userInfo, "UserInfo", N_("User information") },
{ relatedFile, "RelatedFile", N_("Related file") },
{ dateTime, "DateTime", N_("Date and time") },
{ captureCond, "CaptureConditions", N_("Picture taking conditions") },
{ gpsTags, "GPS", N_("GPS information") },
{ iopTags, "Interoperability", N_("Interoperability information") },
{ mpfTags, "MPF", N_("CIPA Multi-Picture Format") },
{ makerTags, "Makernote", N_("Vendor specific information") },
{ dngTags, "DngTags", N_("Adobe DNG tags") },
{ panaRaw, "PanasonicRaw", N_("Panasonic RAW tags") },
{ tiffEp, "TIFF/EP", N_("TIFF/EP tags") },
{ tiffPm6, "TIFF&PM6", N_("TIFF PageMaker 6.0 tags") },
{ adobeOpi, "AdobeOPI", N_("Adobe OPI tags") },
{ lastSectionId, "(LastSection)", N_("Last section") }
}

List of all defined Exif sections.

Referenced by Exiv2::ExifTags::sectionName().