exiv2.types

Exiv2 metadata data types and utility classes.

Enums

AccessMode

An identifier for each mode of metadata support.

ByteOrder

Type to express the byte order (little or big endian)

MetadataId

An identifier for each type of metadata.

TypeId

Exiv2 value type identifiers.

Functions

exvGettext

Translate a string using the gettext framework.

Classes

DataBuf

Utility class containing a character array.

Rational

std::pair< int32_t,int32_t >

TypeInfo

Type information lookup functions.

URational

std::pair< uint32_t,uint32_t >

enum AccessMode(value)

Bases: IntEnum

An identifier for each mode of metadata support.

Member Type:

int

Valid values are as follows:

amNone = <AccessMode.amNone: 0>
amRead = <AccessMode.amRead: 1>
amWrite = <AccessMode.amWrite: 2>
amReadWrite = <AccessMode.amReadWrite: 3>
enum ByteOrder(value)

Bases: IntEnum

Type to express the byte order (little or big endian)

Member Type:

int

Valid values are as follows:

invalidByteOrder = <ByteOrder.invalidByteOrder: 0>
littleEndian = <ByteOrder.littleEndian: 1>
bigEndian = <ByteOrder.bigEndian: 2>
class DataBuf

Bases: SwigPyObject

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.

__annotations__ = {}
__len__()

Return len(self).

alloc()

Allocate a data buffer of at least the given size. Note that if the requested size is less than the current buffer size, no new memory is allocated and the buffer size doesn’t change.

cmpBytes()

Equivalent to: memcmp(&pData_[offset], buf, bufsize)

data()

Returns a temporary Python memoryview of the object’s data.

Return type:

memoryview

empty()
reset()

Reset value

resize()

Resize the buffer. Existing data is preserved (like std::realloc()).

size()
enum MetadataId(value)

Bases: IntEnum

An identifier for each type of metadata.

Member Type:

int

Valid values are as follows:

mdNone = <MetadataId.mdNone: 0>
mdExif = <MetadataId.mdExif: 1>
mdIptc = <MetadataId.mdIptc: 2>
mdComment = <MetadataId.mdComment: 4>
mdXmp = <MetadataId.mdXmp: 8>
mdIccProfile = <MetadataId.mdIccProfile: 16>
class Rational

Bases: SwigPyObject

std::pair< int32_t,int32_t >

__annotations__ = {}
__delitem__(key, /)

Delete self[key].

__getitem__(key, /)

Return self[key].

__len__()

Return len(self).

__setitem__(key, value, /)

Set self[key] to value.

first
second
enum TypeId(value)

Bases: IntEnum

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.

Member Type:

int

Valid values are as follows:

unsignedByte = <TypeId.unsignedByte: 1>

Exif BYTE type, 8-bit unsigned integer.

asciiString = <TypeId.asciiString: 2>

Exif ASCII type, 8-bit byte.

unsignedShort = <TypeId.unsignedShort: 3>

Exif SHORT type, 16-bit (2-byte) unsigned integer.

unsignedLong = <TypeId.unsignedLong: 4>

Exif LONG type, 32-bit (4-byte) unsigned integer.

unsignedRational = <TypeId.unsignedRational: 5>

Exif RATIONAL type, two LONGs: numerator and denominator of a fraction.

signedByte = <TypeId.signedByte: 6>

Exif SBYTE type, an 8-bit signed (twos-complement) integer.

undefined = <TypeId.undefined: 7>

Exif UNDEFINED type, an 8-bit byte that may contain anything.

signedShort = <TypeId.signedShort: 8>

Exif SSHORT type, a 16-bit (2-byte) signed (twos-complement) integer.

signedLong = <TypeId.signedLong: 9>

Exif SLONG type, a 32-bit (4-byte) signed (twos-complement) integer.

signedRational = <TypeId.signedRational: 10>

Exif SRATIONAL type, two SLONGs: numerator and denominator of a fraction.

tiffFloat = <TypeId.tiffFloat: 11>

TIFF FLOAT type, single precision (4-byte) IEEE format.

tiffDouble = <TypeId.tiffDouble: 12>

TIFF DOUBLE type, double precision (8-byte) IEEE format.

tiffIfd = <TypeId.tiffIfd: 13>

TIFF IFD type, 32-bit (4-byte) unsigned integer.

unsignedLongLong = <TypeId.unsignedLongLong: 16>

Exif LONG LONG type, 64-bit (8-byte) unsigned integer.

signedLongLong = <TypeId.signedLongLong: 17>

Exif LONG LONG type, 64-bit (8-byte) signed integer.

tiffIfd8 = <TypeId.tiffIfd8: 18>

TIFF IFD type, 64-bit (8-byte) unsigned integer.

string = <TypeId.string: 65536>

IPTC string type.

date = <TypeId.date: 65537>

IPTC date type.

time = <TypeId.time: 65538>

IPTC time type.

comment = <TypeId.comment: 65539>

Exiv2 type for the Exif user comment.

directory = <TypeId.directory: 65540>

Exiv2 type for a CIFF directory.

xmpText = <TypeId.xmpText: 65541>

XMP text type.

xmpAlt = <TypeId.xmpAlt: 65542>

XMP alternative type.

xmpBag = <TypeId.xmpBag: 65543>

XMP bag type.

xmpSeq = <TypeId.xmpSeq: 65544>

XMP sequence type.

langAlt = <TypeId.langAlt: 65545>

XMP language alternative type.

invalidTypeId = <TypeId.invalidTypeId: 131070>

Invalid type id.

lastTypeId = <TypeId.lastTypeId: 131071>

Last type id.

class TypeInfo

Bases: SwigPyObject

Type information lookup functions. Implemented as a static class.

__annotations__ = {}
static typeId()

Return the type id for a type name

static typeName()

Return the name of the type, 0 if unknown.

static typeSize()

Return the size in bytes of one element of this type

class URational

Bases: SwigPyObject

std::pair< uint32_t,uint32_t >

__annotations__ = {}
__delitem__(key, /)

Delete self[key].

__getitem__(key, /)

Return self[key].

__len__()

Return len(self).

__setitem__(key, value, /)

Set self[key] to value.

first
second