The EXIFData library for Python provides a simplified and consistent way to work with embedded image metadata in the EXIF, IPTC and XMP formats. The library can be used to parse and create metadata in these formats which can be read from or embedded into image files such as TIFF and JPEG images.
The EXIFData library provides support for parsing and creating raw metadata payloads of these formats while delegating responsibility to PyVIPS to perform the extraction of and embedding of the raw metadata payloads. Future versions of the library may offer support for reading and writing a number of image file formats directly.
The EXIFData library has been tested to work with Python 3.10, 3.11, 3.12 and 3.13, but has not been tested, nor is its use supported with earlier versions of Python.
The library is available from the PyPI repository, so may be added easily to a project's
dependencies via its requirements.txt file or similar by referencing the library's
name, exifdata, or the library may be installed directly onto your local development
system using pip install by entering the following command:
$ pip install exifdata
If you would like to install the optional pyvips dependency with the library, use:
$ pip install "exifdata[pyvips]"
PyVIPS is needed if you wish to use open images from disk or to work with in-memory images opened previously by PyVIPS. If you do not already have PyVIPS installed, it is best to install it along with the library to ensure all functionality is available.
The EXIFData library provides access to each of the supported metadata models as a class that offers a number of namespaces, with each namespace offering the full selection of metadata fields provided by that namespace.
The structure of the models is as follows, where each model offers several namespaces, and each namespace offers many fields, that each provide access to one or more values depending on the field, its data type, and its semantics:
┌─────────┐ ┌─────────┐
┌────▶│ Field ├───────▶│ Value │
│ └─────────┘ └─────────┘
┌─────────────┐ │ ┌─────────┐ ┌─────────┐
┌───▶│ Namespace ├───┴────▶│ Field ├───────▶│ Value │
│ └─────────────┘ └─────────┘ └─────────┘
┌─────────┐ │ ┌─────────────┐ ┌─────────┐ ┌─────────┐
│ Model │────┼───▶│ Namespace │────────▶│ Field ├───────▶│ Value │
└─────────┘ │ └─────────────┘ └─────────┘ └─────────┘
│ ┌─────────────┐ ┌─────────┐ ┌─────────┐
└───▶│ Namespace │────┬───▶│ Field ├───────▶│ Value │
└─────────────┘ │ └─────────┘ └─────────┘
│ ┌─────────┐ ┌─────────┐
└───▶│ Field ├───────▶│ Value │
└─────────┘ └─────────┘
For example, the IPTC model offers several namespaces including the envelope, and
application, namespaces, while the XMP model offers many namespaces of its own
including basic, photoshop, and dc. These namespaces then provide access to the
metadata fields for reading and writing.
To assign a value to the XMP metadata model's dc.title field for example, one would
either access an existing instance of the XMP model class, or create one, and would
then reference and assign a value to the title field held within the dc namespace
as follows:
xmp.dc.title = "this is a title"In order to read a value from a field, one would just reference the field like any other
property, and if the field has an assigned value that can be decoded, its value will be
available as an instance of the library's Value class.
The Value class and its subclasses exist to support encoding and decoding of the raw
value types defined by each of the metadata standards.
print(xmp.dc.title)Furthermore, where possible, the Value class types themselves subclass native Python
types including str, int, float, and datetime, so these Value class instances
can be used interchangeably like the corresponding native type would be used; however by
necessity some of the Value subclasses represent structured data types and provide
additional fields or methods to access and assign the nested values, so must be used
directly where the field requires it.
Each metadata model's supported namespaces and fields are documented with information about the relevant value types, which detail how to access and assign values to each of the supported fields.
The following table lists the currently supported metadata models along with links to documentation, detailing each model's available namespaces and fields:
| Metadata Model | Documentation |
|---|---|
| EXIF | EXIF Namespaces & Fields |
| IPTC | IPTC Namespaces & Fields |
| XMP | XMP Namespaces & Fields |
The EXIFData library also offers some convenience methods to make it easy to read and write the supported embedded metadata in supported image file formats; currently the library relies on the PyVIPS library to read and write the image files, and perform the extraction and insertion of the raw metadata payloads, before handing off responsibility to the EXIFData library to decode and encode the raw metadata payloads and their nested namespaces, fields and values.
See the Classes & Methods section below for more information on the available interfaces and their use; and see the Supported File Formats section for more information on the image file formats that are currently supported by the library, which includes JPEG, TIFF and Pyramidal TIFF images.
The code sample below illustrates the use of the EXIFData library to read metadata:
import exifdata
# Open an image file from disk and attempt to parse its embedded metadata
models = exifdata.Models.open("/path/to/image-file.jpg")
# Print out the existing metadata model assigned fields and values
for model in models:
print(model.name)
for field, value in model.items(all=False):
print(" -> %s => %s" % (field, value))The code sample below illustrates the use of the EXIFData library to write metadata:
import exifdata
models = exifdata.Models.open("/path/to/image-file.jpg")
models.xmp.basic.title = "test title"
models.iptc.credit = "test credit"
# Save the image back to disk
models.save()import exifdata
import pyvips
# Open the desired image file using PyVIPS
image = pyvips.Image.new_from_file("/path/to/image-file.tiff")
# Attempt to decode the metadata models from the provided image using EXIFData
models = exifdata.Models.load(image)
# Print out the existing metadata model assigned fields and values
for model in models:
print(model.name)
for field, value in model.items(all=False):
print(" -> %s => %s" % (field, value))
# Set or update the desired metadata fields
models.xmp.basic.title = "test title"
models.iptc.credit = "test credit"
# Encode the updated metadata and embed it into the in-memory image buffer
models.encode()
# Save the image back to disk or capture the image into a buffer as needed
image.tiffsave()Image class instance
one must remember to save the image or otherwise do something with the updated in-memory
image buffer as the call to the models.encode() method only encodes and embeds the
metadata into the in-memory image buffer. While the in-memory image buffer will then
contain the metadata, if one needs to save the image back to disk, that must be handled
as a separate call to PyVIPS.
The Models class offers the following methods:
-
adapt(adapter: Adapter)– Theadapt()method provides support for associating the specifiedAdapterclass type with theModelsclass to allow the specified adapter to be used to assist in reading and writing image files. -
load(filepath: str)– Theload()method provides support for loading the specified image file from thefilepathwhich must exist and reference an image in a usable image file format. If the referenced image file does not exist or cannot be loaded an error is reported. -
associate(image: object)– Theassociate()method provides support for associating the specified in-memory image with theModelsclass instance, which sets the reference to the image without attempting to extract or decode any of the pre-existing metadata in the image. -
open(image: object)– Theopen()method provides support for associating the specified in-memory image with theModelsclass instance, which sets the reference to the image and then proceeds to attempt extracting and decoding any pre-existing metadata in the image. -
update(model: Metadata)– Theupdate()method provides support for updating the metadata models held by theModelsclass instance with newMetadatamodel subclass instances if needed; if a matchingMetadatamodel subclass has already been registered with theModelsclass then it will be replaced by the providedMetadatainstance and if no match is found then the the providedMetadatainstance will be registered. -
assign(name: str, value: object)– Theassign()method provides support to assign metadata model values to any of the supported metadata models via the metadata field's fully qualified name, along with a supported value. If the provided name can be matched with a name associated with one or more metadata model fields, and if the provided value is valid, then the value will be assigned to the matching metadata model fields. This offers an alternative method to setting metadata model field values via the property accessor pattern. -
erase(payloads: list[str] = None)– Theerase()method provides support for erasing erasable metadata held in the associated image from either the specified payloads if one or more supported payload names are specified, or from all of the metadata payloads if no payloads are specified. The payloads and/or their embedded fields that are removed from an image are dependent on the metadata payload as some fields are mandatory so they cannot be removed, such as many of the fields in the EXIF payload. -
decode(order: ByteOrder)– Thedecode()method provides support for decoding the embedded metadata payloads contained in the associated image file, and if metadata is found within the image and can be successfully decoded, the relevant metadata model field values will be populated with the decoded values. The values can then be read and otherwise used, and if desired, the values can be modified or cleared, before saving the updated metadata back to the associated image. -
encode(order: ByteOrder)– Theencode()method provides support for encoding the assigned metadata model field values into encoded metadata payloads suitable for storing into the associated image file.
The Models class offers the following properties:
-
adapter(Adapter) – Theadapterproperty provides access to the reference to the currentAdapterclass instance associated with theModelsclass. TheAdapterclass is used by theModelsclass to interact with image data and raw metadata via various libraries such as PyVIPS, EXIFTool and TIFFData. -
model(Metadata) - Themodelproperty provides support for assigning one or moreMetadatamodel class instances to theModelsclass. The property can only be used to assignMetadatamodel class instances to theModelsclass, it cannot be used to get any of the assignedMetadatamodel class instances; instead this can be achieved by iterating over theModelsclass instance as theModelsclass supports the iterator protocol to provide access to the assignedMetadatamodel class instances using the standardfor ... in ...pattern. -
exif(EXIF) – Theexifproperty provides support for accessing theEXIFmodel instance associated with theModelsclass, which can then be used to access any of the decoded metadata model field values or to assign or clear metadata model field values associated with the EXIF metadata model. -
iptc(IPTC) – Theiptcproperty provides support for accessing theIPTCmodel instance associated with theModelsclass, which can then be used to access any of the decoded metadata model field values or to assign or clear metadata model field values associated with the IPTC metadata model. -
xmp(XMP) – Thexmpproperty provides support for accessing theXMPmodel instance associated with theModelsclass, which can then be used to access any of the decoded metadata model field values or to assign or clear metadata model field values associated with the XMP metadata model.
The Metadata class provides the following methods:
-
register_type(type: Type, klass: Value)– Theregister_type()method is used by the EXIFData library internally to registerValuesubclass types for field types, as defined by theirTypeenumeration class option values. TheValuesubclasses provide support for encoding and decoding metadata model field values according to the needs of the specific metadata model. The method should not be used directly unless developing an update for the EXIFData library. -
register_types(*types: tuple[type])– Theregister_types()method is used by the EXIFData library internally to register multipleValuesubclass types for field types. TheValuesubclasses provide support for encoding and decoding metadata model field values according to the needs of the specific metadata model. The method should not be used directly unless developing an update for the EXIFData library. -
type_by_name(name: str)(Value|None) – Thetype_by_name()method provides support for accessing a registeredValuetype subclass by its name. This method is used internally by the library and likely does not need to be used directly unless developing an update for the EXIFData library. -
field_by_id(id: str)(Field|None) – Thefield_by_id()provides support for looking up a field by its identifier. If a match can be found the matchingFieldwill be returned, otherwise the method will returnNone. -
field_by_name(name: str)(Field|None) – Thefield_by_name()provides support for looking up a field by its name. If a match can be found the matchingFieldwill be returned, otherwise the method will returnNone. -
field_by_property(property: str, value: object)(Field|None) – Thefield_by_property()method provides support for looking up a field by one of its named properties where a match is sought for the specified value. If a match can be found the matchingFieldwill be returned, otherwise the method will returnNone. -
get(name: str, default: object = None)– Theget()method provides support for obtaining the value set for the named metadata model class field, if a value has previously been assigned. If no value was previously assigned the method will return the default value if one has been assigned orNone. -
set(value: Value, name: str = None, field: Field = None, namespace: Namespace = None)– Theset()method provides support for setting a value on the metadata model class. If the provided value held in aValuesubclass instance has its own reference to aFieldclass instance, the field name can be determined from theFieldand does not need to be specified directly, otherwise thenameargument can optionally be specified to provide the field name. If aNamespaceclass instance is optionally specified via thenamespaceargument, then the field value will be stored within that namespace; if a namespace is not specified directly, but aFieldclass instance is referenced by the value, then the namespace can be determined from theFieldclass instance. -
items(all: bool = False)(Generator) – Theitems()method provides support for iterating over the metadata model's fields and associated values. The generator yieldstuplevalues that hold aFieldclass instance and its correspondingValueclass instance for all the metadata model fields that have assigned values. If theallflag is set toTruethe method will yield atupleholding aFieldclass instance and aValueclass instance for every registered field in the metadata model, even if some of the fields do not have assigned values. The returnedValueclass instances in those cases will holdNonevalues indicating that the field does not have an assigned value. -
keys()(list[str]) – Thekeys()method provides support for obtaining a list of all of the names of the fields associated with the metadata model class. -
values()(list[Value]) – Thevalues()method provides support for obtaining a list of all of the values of the fields associated with the metadata model class, where the values are held inValuesubclass instances. Where a field does not have a current value, aValuesubclass instance holding aNonevalue will be returned in its place indicating that the field does not have an assigned value; the order of the items in the list matches the order of the field names provided by thekeys()method so the two can be used together if needed as an alternative way of accessing the field names and values. -
encode(order: ByteOrder)- Theencode()method provides support for encoding the metadata model's assigned metadata fields and values into a binary format suitable for embedding within the associated image. -
decode(order: ByteOrder)- Thedecode()method provides support for decoding the binary encoded metadata payload obtained from the associated image and attempting to parse the fields and values from the payload, and if successful, assigning those fields and corresponding values to the current metadata model class instance for later use. -
dump(all: bool = False)(caselessdict[str, object]) – Thedump()method is used for development and can be used to obtain a dictionary of the metadata model's assigned values with each value being associated against the model's field name. A dictionary is returned that supports case-less matching of its keys so values can be retrieved if a match can be found for the key regardless of if the casing of the key. If theallflag is set toTruethe dictionary will be populated with the full list of metadata model fields even if no value has been assigned to that field in the current model instance.
The Metadata class provides the following properties:
-
name(str) – Thenameproperty provides access to theMetadatamodel subclass' name, such as "EXIF", "IPTC" and "XMP". -
namespace(Namespace) – Thenamespaceproperty provides access to get and set the model's currently assignedNamespaceclass instance. This property is used by the library internally and likely does not need to be used directly unless developing an update for the EXIFData library. -
namespaces(dict[str, Namespace]) – Thenamespacesproperty provides access to a dictionary of the model's currently assignedNamespaceclass instances. This property is used by the library internally and likely does not need to be used directly unless developing an update for the EXIFData library. -
aliases(dict[str, Namespace | Groupspace]) – Thealiasesproperty provides access to a dictionary of the model's currently assignedNamespaceandGroupspaceclass instances. These are used to keep track of aliases for the namespaces which make working with the namespaces easier as some have long and unwieldy assigned names in the specifications, and the library offers shorter more concise names where practical. This property is used by the library internally and likely does not need to be used directly unless developing an update for the EXIFData library. -
fields(dict[str, Value]) – Thefieldsproperty provides access to the metadata model's fields via a dictionary where the keys are the field names and the values are the assignedFieldclass instances holding information about the field that has been sourced from the metadata model configuration. -
values(dict[str, Value]) – Thevaluesproperty provides access to the metadata model's currently assigned field values via a dictionary where the keys are the field names and the values are the assignedValuesubclass instances holding the value.
The Namespace class provides a structured method for grouping metadata model fields by
their namespace, and providing support for a metadata model to hold multiple namespaces
simultaneously each with their own set of metadata fields and values. The namespaces are
created dynamically when the metadata model classes are parsed with the namespaces being
determined from the metadata model class' schema configuration.
The Namespace class provides the following methods:
-
get(metadata: Metadata, field: Field)(Value|None) – Theget()method can be used to obtain the specified metadata model field value, if it has been set previously, with the value being returned as aValuesubclass instance if a value has been set. -
set(metadata: Metadata, field: Field, value: Value)– Theset()method can be used to set the specified metadata model field value to value held by the assignedValuesubclass instance. -
items()(Generator) – Theitems()method provides support for iterating over the namespace's assigned fields. The generator yieldstuplevalues that hold the name of the field and the correspondingFieldclass instance. -
keys()(list[str]) – Thekeys()method provides support for obtaining a list of all of the names of the fields associated with the namespace class instance. -
values()(list[Value]) – Thevalues()method provides support for obtaining a list of all of the values of the fields associated with the namespace instance, where the values are held inValuesubclass instances. Where a field does not have a current value, aValuesubclass instance holding aNonevalue will be returned in its place indicating that the field does not have an assigned value; the order of the items in the list matches the order of the field names provided by thekeys()method so the two can be used together if needed as an alternative way of accessing the field names and values.
The Namespace class provides the following properties:
-
id(str) – Theidproperty provides access to the namespace's identifier. -
name(str) – Thenameproperty provides access to the namespace's name. -
uri(str) – Theuriproperty provides access to the namespace's URI. -
prefix(str) – Theprefixproperty provides access to the namespace's prefix. -
alias(str|None) – Thealiasproperty provides access to the namespace's alias, if one has been set, otherwiseNonewill be returned. -
definition(str|None) – Thedefinitionproperty provides access to the namespace's descriptive definition, sourced from the metadata model class' schema if one has been set, otherwiseNonewill be returned. -
metadata(Metadata) – Themetadataproperty provides access to get and set the namespace's associatedMetadatamodel class instance. -
structures(list[Structure]) – Thestructuresproperty provides access to the list ofStructureclass instances associated with the namespace, if any have been set in the metadata model class' schema. -
utilized(bool) – Theutilizedproperty provides support for determining if the currentNamespaceclass instance has been utilized in the current program, which means that at least one metadata model field has been set within the namespace. The property will returnTrueif at least one field has been set orFalseotherwise. This status is used internally by the library when encoding a metadata model's data, whereby if the namespace has not been utilized, it will be excluded by the encoding process. -
unwrap(bool) – Theunwrapproperty provides access to theunwrapproperty set in the metadata model class' schema, which the library uses to determine if it should "unwrap" the namespaces fields into its parent's namespace – that is to make the fields directly accessible from the parentMetadatamodel class rather than indirectly via the namespace. This field is used internally by the library and likely does not need to be used directly unless developing an update for the EXIFData library. -
fields(dict[str, Field]) – Thefieldsproperty is used internally by the library to associate registered metadata model fields against the namespace. The property expects a dictionary with string keys holding the fully qualified field names andFieldclass instances as the values. This field is used internally by the library and should not need to be used directly unless developing an update for the EXIFData library. -
field(Field) – Thefieldproperty is used internally by the library to associate a registered metadata model field against the namespace. The property expects aFieldclass instances as its value. This field is used internally by the library and should not need to be used directly unless developing an update for the EXIFData library. -
value(Value) - Thevalueproperty is used internally by the library to associate assigned metadata model namespace field values with the namespace. The property expects aValueclass instances as its value. TheValueclass instance must hold references to the relevantMetadatamodel class instance andFieldclass instance so that the value can be assigned to the correct field under the correct metadata model. The field is used internally by the library and should not need to be used directly unless developing an update for the EXIFData library.
The Groupspace class provides a structured method for grouping one or more namespaces
together to make assigning field values to those namespaces easier for certain uses. The
Groupspace class instances streamline support for aliasing the namespaces and are used
internally by the library and likely does not need to be used directly unless developing
an update for the EXIFData library.
The Groupspace class provides its own implementations of the standard library getter
and setter methods to support assigning field values to the relevant Namespace class
instance held by the Groupspace class instance.
The Groupspace class provides the following properties:
-
namespaces(list[Namespace]) – Thenamespacesproperty provides access to the list of namespaces associated with theGroupspaceclass instance. -
metadata(Metadata) – Themetadataproperty provides access to get and set the associatedMetadatamodel class instance for theGroupspaceclass instance. This is used when interacting with the underlyingNamespaceclass instances so that they can interface with the correctMetadatamodel class instance.
The Field class provides a controlled method for holding information about metadata
model fields, including their identifier, name, label, definition, acceptable value data
types, acceptable value ranges, whether the field can hold multiple values or not, and
all other relevant field configuration information that is used both when decoding raw
metadata payloads and assembling encoded payloads as well as during value assignment.
The Field class provides the following methods:
value(value: object, metadata: Metadata = None)– Thevalue()method provides support for assigning a value to the field against its associated namespace and metadata model class instance. Themetadataargument is optional, but can be used to override the metadata model that the field value will be assigned to if needed.
The Field class provides the following properties:
-
namespace(Namespace) – Thenamespaceproperty provides access to theFieldclass associated namespace. -
identifier(str|int) – Theidentifierproperty provides access to the field's identifier. -
name(str) – Thenameproperty provides access to the field's name. -
type(str|list[str]|tuple[str]|set[str]) – Thetypeproperty provides access to the field's accepted data type or types as defined by the name of the accepted data types. -
structure(Structure|str) – Thestructureproperty provides access to the field's associatedStructureclass instance or structure name if one has been defined. -
alias(str|list[str]) – Thealiasproperty provides access to the field's associated field name alias or aliases if any have been defined. The field name aliases provide support for accessing fields via aliases as well as their assigned names. -
pseudonym(str|list[str]|dict[str, str]) – Thepseudonymproperty provides access to the registered pseudonyms for a field, these are names that are used for the field in other software such as EXIFTool which helps support interoperability. -
encoding(Encoding|str) – Theencodingproperty provides access to the value encoding used the field, expressed as anEncodingenumeration class option or string. -
unit(str) – Theunitproperty provides access to the name of the measurement unit associated with the values held by the field. -
tag(int) – Thetagproperty provides access to the field's associated tag identifier value, such as the tag identifiers used to uniquely identify the fields in the EXIF metadata and IPTC metadata models. -
ordered(bool) – Theorderedproperty provides access to theorderedflag that notes if the value held by the field should have its ordering preserved or not. -
minimum(int|float) – Theminimumproperty provides access to the minimum numeric value that can be held by the field, when the field has been configured to hold a numeric value with a defined minimum. -
maximum(int|float) – Themaximumproperty provides access to the maximum numeric value that can be held by the field, when the field has been configured to hold a numeric value with a defined maximum. -
options(list[object]) – Theoptionsproperty provides access to the list of acceptable values that can be held by the field for fields that have such a list. -
closed(bool) – Theclosedproperty provides access to theclosedflag which notes whether a field must be assigned a value from a predefined (closed) list of options or whether the field can be assigned a value from the list of options as well as others. -
nullable(bool) – Thenullableproperty provides access to thenullableflag which notes if the field can hold a null (None) value or not. -
required(bool) – Therequiredproperty provides access to therequiredflag which notes if the field holds a required value or not, where a value must be assigned if the field is marked as being required. -
readonly(bool) – Thereadonlyproperty provides access to thereadonlyflag which notes if the field holds a read only value or not. Fields with read only values can be used to access values parsed and decoded from embedded metadata payloads but the field cannot change its value. -
count(int|tuple[int]) – Thecountproperty provides access to the number or numbers values that the field must hold if a count has been specified. This property is also used to hold the minimum and maximum lengths of string and bytes fields. -
multiple(bool) – Themultipleproperty provides access to themultipleflag which notes if the field supports holding more than one value or not. -
combine(bool) – Thecombineproperty provides access to thecombineflag that notes whether the values held by the field should be combined or not. -
label(str) – Thelabelproperty provides access to the field's label if one has been set in the model class' schema. -
definition(str) – Thedefinitionproperty provides access to the field's descriptive definition if one has been set in the model class' schema. -
related(Field|str) – Therelatedproperty provides access to a reference to the field's relatedFieldif one has been specified. -
section(str) – Thesectionproperty provides access to the documentation section reference for the metadata field, if one has been set in the model class' schema.
The Value class provides the following methods:
-
validate()(bool) – Thevalidate()method provides support for validating the value held by theValuesubclass instance to determine if it is valid according to the metadata model class' schema configuration. -
decode(value: bytes, order: ByteOrder)(Value) – Thedecode()method provides support for decoding a raw binary encoded value extracted from the metadata payload into its corresponding value which will be returned as aValuesubclass instance. -
encode(order: ByteOrder)(bytes) – Theencode()method provides support for encoding the value held by theValuesubclass instance into a form suitable for use as part of the metadata model's encoded payload.
The Value class provides the following properties:
-
value(object) – Thevalueproperty provides access to the underlying value held by theValuesubclass instance. -
encoding(Encoding) – Theencodingproperty provides access to the associated encoding of the value field, expressed as anEncodingenumeration class option value. -
field(Field|None) – Thefieldproperty provides access to the associated instance of theFieldclass if one has been assigned. -
metadata(Metadata|None) – Themetadataproperty provides access to the associated instance of theMetadataclass if one has been assigned.
The Structure class provides a controlled method for holding metadata model field
structure information extracted and assigned dynamically from the metadata model class'
schema configuration. The structure information is used internally by the library when
encoding metadata into its encoded form as defined by the associated metadata standard.
The Structure class provides the following properties:
-
id(str) – Theidproperty provides access to the structure's identifier. -
identifier(str) – Theidentifierproperty provides access to the structure's identifier. -
name(str) – Thenameproperty provides access to the structure's name. -
type(str) – Theidproperty provides access to the structure's type name. -
kind(str) – Theidproperty provides access to the structure's kind descriptor.
The Type class enumeration class provides a controlled method for keeping track of the
registered field value types supported by each metadata model. The field value types are
registered by the metadata model classes dynamically when they are parsed with the types
being determined from the metadata model class' schema configuration.
The EXIFData library has been tested with a range of image file formats to determine the accessibility of and ability to write embedded metadata, those file formats are listed in the table below and with whether the file format supports reading or writing or both. As the library currently relies upon PyVIPS for loading and saving image files, it may be the case that additional file formats are found to work with the library, or support may be added for additional file formats over time. The EXIFData library's ability to support an image file format depends on the file format itself as there are myriad image file formats and embedded metadata standards. Although EXIF, IPTC and XMP are considered the most common, these standards are not supported by every image file format.
| File Format | EXIF Read | EXIF Write | IPTC Read | IPTC Write | XMP Read | XMP Write |
|---|---|---|---|---|---|---|
| JPEG | No* | Yes | Yes | Yes | No* | Yes |
| TIFF | No* | Yes | Yes | Yes | No* | Yes |
| PyramidTIFF | No* | Yes | Yes | Yes | No* | Yes |
| PNG | * | * | * | * | * | * |
| HEIF | * | * | * | * | * | * |
- EXIF and XMP read capability is in development and will be added in a future release.
- Support for other image file formats is currently in development.
While every effort has been made to ensure that the library works reliably with embedded image metadata, you must ensure that all files are backed up before using the EXIFData library with any files especially as the library is still in early development.
Furthermore, the library may not be able to read nor preserve all metadata field values from an image file, especially if manufacturer specific or custom metadata model values are present, so it is possible that loss of embedded metadata could occur if an image is loaded into the library and is then overwritten if the file is saved to the same path.
Use of the library is entirely at your own risk and the authors bear no responsibility for losses of any kind. By using the software you assume all such risk and liability.
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The EXIF, IPTC and XMP metadata model specifications were researched across various sources. Please visit these valuable online resources to learn more about the metadata model specifications and to support these world class organizations and their products:
-
EXIF Metadata Model & Fields
-
IPTC Metadata Model & Fields
-
XMP Metadata Model & Fields
Copyright © 2024–2025 Daniel Sissman; licensed under the MIT License.