Feature #463

Add support for XMP metadata

Added by Andreas Huggel almost 11 years ago. Updated over 8 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Andreas Huggel% Done:


Target version:0.16


XMP metadata can be supported as a new type of metadata - with conversions to/from Exif/IPTC
or XMP as a new data format to read Exif and IPTC data from - in this case, the read/write functions need to know which format to prioritize.

Additional information:

First, this requires further research and a decision whether it makes sense to support XMP with the Exiv2 framework.

Related issues

Related to Exiv2 - Feature #532: Conversion of IPTC/Exif metadata to XMP and vice versa Closed


#1 Updated by Andreas Huggel about 10 years ago

This is roughly how I see XMP support:

+ It is a new type of metadata, only the extended IPTC stuff is
supported for a start (Dublin Core schema).
The related metadata keys will start with Xmp instead of Exif
or Iptc.
+ A new class XmpData is the container for XMP data (copy and paste
IptcData to get started - not the other one)
+ Use an XML parser to help decoding and encoding from the XML structure
to Exiv2 Key/Value Metadatum (Xmpdatum) objects (my guess is libxml2,
but I haven't evaluated any yet). This will be the most
interesting part.
+ Start with JPEG format (or maybe PNG)

Ok, thanks. For these informations.

I never used libxml2 because Qt have a perfect XML parser. But F-SPOT use this
one if i remember (in all case, it' support XMP)

Also, Gimp currently support partially XMP (in current implementation from cvs

Also, there is the official XMP toolkit from Adobe witch can use like a
reference if we have some problem to implemente it into Exiv2...

#2 Updated by Andreas Huggel about 10 years ago

Some additional info about XML parsers is in this thread:


(and this note is mainly to test if it goes to the group now.)

#3 Updated by mikolaj - almost 10 years ago

Adobe released XMP toolkit under BSD license:


#4 Updated by Gilles Caulier almost 10 years ago


I recommend you to take a look here :


This way can be a fast solution to add XMP support on Exiv2

Gille Caulier

#5 Updated by Gilles Caulier almost 10 years ago


Exempi2 library source code is here :


Gilles Caulier

#6 Updated by Andreas Huggel almost 10 years ago

Copied from http://thread.gmane.org/gmane.comp.kde.digikam.devel/16717:

XMP support in Exiv2 should use the existing Exiv2 API and
infrastructure where possible. In particular, the interface to access
XMP metadata in files should remain Exiv2::Image so that a call to
Exiv2::Image::readMetadata() scans a file only once and loads Exif,
IPTC as well as XMP into tag/value structures (ExifData, IptcData,
XmpData for the time being, eventually, a common class for all
metadata). This implies that in Exiv2, XMP tags will be accessed with
keys, similar to the existing Exif and IPTC keys. "Standard" conversion
classes to convert between Exif, IPTC and XMP could then become part of
If that cannot be done, then I don't see the point of adding XMP support
to Exiv2.
Where I see a potential to save time by using Adobe's library/exempi is
with the low-level decoding and encoding parts, i.e., scanning XML to
decode the relevant bits (the "keys" and the "values") and the other
way around on write. And maybe they have code to access file types
which Exiv2 doesn't support yet.

Another alternative is of course to use 2 libraries, one for XMP and one
for Exif/IPTC and develop conversion classes outside of both of them.
But this would require that the client calls each library's API to read
its respective metadata, i.e., scans the file twice, and that the
application maintains the conversion code.

Would it help in the short term if Exiv2::Image provided some kind of
getXmp/setXmp methods (at least for JPEGs) which would just deal with
std::string BLOBs containing the raw XML? This would allow to
read/write the data using Exiv2::Image::read/writeMetadata but require
some other means to parse the XML.

#7 Updated by Andreas Huggel almost 10 years ago


Added Exiv2::Image::xmpPacket() which can be used to dump the
XMP packet of JPEG images (APP1 XMP segment) and TIFF or related RAW
images (IFD0 tag 700) as per the XMP specs. Read-only access for a
start and no parsing of the XML yet.

#8 Updated by Andreas Huggel almost 10 years ago

On Wednesday 20 June 2007 16:33, Gilles Caulier wrote:

Where we will store XMP schema from Adobe, M$ etc...?

Look ExifTool database for details :

This is the job to Exiv2 or a high level interface as libkexiv2 ?

My preliminary thinking is that Exiv2 will use these just like the
existing tag lists. Exiv2 XMP key strings would then be

"Xmp.exif.ApertureValue", "Xmp.iptcCore.CountryCode"
or "Xmp.photoshop.Category" etc.

Or are there more levels than namespace and tag name? i.e., can XML
namespaces be nested?


#9 Updated by Andreas Huggel over 9 years ago

Conversion between XMP and IPTC/Exif not done yet, I'll raise a new issue for that.

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux