writing a caption to a jpeg file so that digikam will recognize it

Jim Gomi gomi at mailup.net
Tue Dec 27 21:38:31 GMT 2016


On Tue, 2016-12-27 at 21:00 +0100, Gilles Caulier wrote:
> The lead XMP namespace is "digiKam". We store all metadata that we
> cannot store in usual XMP namespaces. Start by this one.
> 
> http://www.exiv2.org/tags-xmp-digiKam.html

Thank you, but I don't see any information there about which metadata
tags digikam uses to store the text of the Caption itself.

However, I've done some investigation of how digikam behaves in the
wild.

If I use exiv2 to read all the metadata tags, I get 6 that store the
caption:
exiv2 -pa IMG_0910.JPG
...
Exif.Image.ImageDescription  Ascii      22  This is a picture of a person
Exif.Photo.UserComment       Undefined  29  This is a picture of a person
Iptc.Application2.Caption    String     21  This is a picture of a person
Xmp.tiff.ImageDescription    LangAlt     1  lang="x-default" This is a picture of a person
Xmp.exif.UserComment         LangAlt     1  lang="x-default" This is a picture of a person
Xmp.dc.description           LangAlt     1  lang="x-default" This is a picture of a person
...

In order to get digikam to see a different caption, e.g. "Happy
People", I need to overwrite TWO of those tags:

exiv2 -M'set Xmp.exif.UserComment lang="x-default" Happy People' IMG_0910.JPG
exiv2 -M'set Xmp.dc.description lang="x-default" Happy People' IMG_0910.JPG

As long as I rewrite BOTH those tags, digikam sees the new caption.
The other tags with the old caption are still there (originally written
by digikam itself!) but are ignored:

exiv2 -pa IMG_0910.JPG
...
Exif.Image.ImageDescription   Ascii      22  This is a picture of a person
Exif.Photo.UserComment        Undefined  29  This is a picture of a person
Iptc.Application2.Caption     String     21  This is a picture of a person
Xmp.tiff.ImageDescription     LangAlt     1  lang="x-default" This is a picture of a person
Xmp.exif.UserComment          LangAlt     1  lang="x-default" Happy People
Xmp.dc.description            LangAlt     1  lang="x-default" Happy People
...





More information about the Digikam-users mailing list