[Digikam-users] Import labels tree from external files

Michael G. Hansen mike at mghansen.de
Wed Nov 25 08:44:17 GMT 2009


Marco Uliana wrote:
> Dear Digikam users, I am new both to DigiKam and to KDE (I am running them
> on Windows Vista OS).
> 
> I am searching the best software to manage my collection of zoological
> photos and I am evaluating DigiKam against similar products, mainly
> IDimager. 
> 
>  
> 
> My first question is: is there a way to import a tree of hierarchical labels
> from an external file (excel table, csv file, etc.)? I ask this because I
> have a complete taxonomic tree containing thousands of names, which I want
> to directly implement in my photo organizing software.

You can use the exiv2 command line tool to update the tags that Digikam
stores in XMP. I am not sure whether you want to just import your tag
structure, or directly apply them to the images, but this method works
both ways.

For each image, create a text file, containing your tags. Subtags are
given as "parent/child/grandchild":
set Xmp.digiKam.TagsList[1] animal
set Xmp.digiKam.TagsList[2] animal/elephant
set Xmp.digiKam.TagsList[3] size/big
set Xmp.digiKam.TagsList[4] eats/food/peanuts

Then simply call:
exiv2 -m yourfile yourimage

And the tags are in the image. Note that the image only gets the tag
"size" if you also set "size" on its own instead of just "size/big". You
can extend the file to also write the tags to xmp subject and other
places, take a look at the exiv2 manpage.

If you just want to import all of your tag structure and apply them to
images in Digikam, simply create a dummy image and apply all of your
tags to it, then Digikam will import the tags and you can use them on
other images.

Hope that helps,

Michael

PS: Be sure to do "Images->Re-read metadata from image" when you have
changed the metadata using exiv2.




More information about the Digikam-users mailing list