[Digikam-devel] Image history in metadata

Marcel Wiesweg marcel.wiesweg at gmx.de
Fri Jun 11 19:57:16 BST 2010


> If someone is going to show how Image metadata is handled in digiKam, I
> want to learn this too. Will be very useful to me for later work.

All of the hard work is done for us by libexiv2. We have written a wrapper 
around that, libkexiv2, so you usually dont come in touch with exiv2's API at 
all.

Have a look at the API documentation in libkexiv2/kexiv2.h. The API has grown 
over the years and there are many different methods, but it's all right.
There are three similar groups of methods to read and write Exif, IPTC and XMP 
metadata. Additionally, there are some "meta" methods that read multiple keys 
for any of these three, like comment or rating.
We use keys defined by exiv2 to identify the metadata to be read or written, 
the reference can be found on exiv2.org: http://www.exiv2.org/tags.html

In digikam, we have the class DMetadata (derived from and extending the KExiv2 
class), which you should use each time you read or edit metadata.
You can open a DMetadata object from a filename and save to a given filename. 
Alternatively, when an image is loaded into a DImg, the metadata will be 
available in memory in the opaque KExiv2Data container, which you can also 
edit with DMetadata.


Marcel



More information about the Digikam-devel mailing list