Import tag hierarchy into darktable from DigiKam ?

Existing Tag Structure

I’ve spent a number of years defining and fine-tuning a suitable tag hierarchy for my photos. I’ve been doing this in digiKam. However, rather than tagging the shots in dK after they’ve been processed in and imported from dt, I’d like to do this immediately in darktable.

Import to darktable

It would be a major pain in the anterior if I had to recreate the entire tag structure in dt (so much so that I wouldn’t even seriously think about doing it). Is there any way that I can import the existing structure much like the way in which I see that Lightroom keyword files can be imported?

“Tag Master”

I’ve noticed that digiKam “imports” any tags assigned to a photo which has made its way into the dK database. This has allowed me to back-up my tag structure by assigning every single one of my tags to one particular jpeg which I refer to as my “Tag Master”. Thus, if the database ever becomes corrupt, I’d be able to easily re-import all of my tags. I had hoped that this functionality would have allowed me to do a similar import of tags into darktable. After having imported both a .jpeg and a .nef version of my Tag Master into the program, it appears that this doesn’t work as I had hoped.

If anybody can provide some direction to show me how I might accomplish what I’m trying to do, I’d be most appreciative.

Can you display the tag hierarchy with an external program such as exiftool or exiv2 or something else?

If you can get a listing of the tags, then you could read the tag list and create it in darktable with a lua script

Can you give a bit more of detail of what you mean by “this doesn’t work as I hoped”. darktable should see the tags in the JPG.

After having opened the files in an exif viewer, neither XMP or IPTC data show the digikam tags. :confused:

Sadly, Guillermo, dt doesn’t see the tags.

This may be the problem, I suppose darktable reads the tags only if they’re in the relevant XMP fields. Where is digikam saving the tags then?

Anyway, you can tell digikam to save the metadata both to the image file and to a sidecar file. If you use the second option the generated XMP file should contain the tags in a format that darktable will read when importing the image (keep the sidecar file next to it).

Another point: are you sure that you have digikam configured to save the metadata to the file, besides it’s own database?

I think that you’ve nailed it, Guillermo. I’ve tried for the past few hours to find how to save the tags to metadata rather than to digiKam’s own database. I’m still searching!

Settings → Configure digiKam, select the “Metadata” section

The options in the “Behaviour” tab control what and when is written to the image files. The “Sidecars” tab controls the use of sidecar files. You can also check in the “Advanced” tab to which fields are tags written (by default it should be to many different fields).

Thanks again, Guillermo. I had already been playing with those options (and made sure that “Image Tags” and “TagsList” were selected).

Where I continue to struggle is when I try to implement this…

I had selected “Sync Metadata and Database (From image metadata to database)” in Maintenance but, the tags weren’t applied after maintenance was performed. Under XMP’s “dikiKam schema”, it still indicates that the Tags List is unavailable.

And… I also set Item > Write Metadata to File . Still no joy.

Got it! My problemn was that I was applying the metadata in the wrong direction. After having selected “From database to image”, the tags were applied !

So, that’s the first part. I’ll sleep on it and then see if somehow I can now get the tag structure into darktable.

  • would it be possible to somehow make dt think that my tag list is a Lightroom “keyword file”? If so, it would appear that dt could import the tags via the gui. I’d rather do that since creating a lua script to do this is well beyond my meager abilities :confounded:

If you’re using the xmp tag keyword then darktable should pick up the keywords. You can open the xmp file in a text editor.

If you can make digiKam export its tag hierarchy as a Lightroom-like keyword file, yes. I don’t know if digiKam can, though.

But if you have the tags written in the JPG, then importing them in darktable should work. However, to avoid duplicates it might be better in digiKam to save only the lr-hierarchical:subject field to the JPG, and remove all the others (Hierarchical tag chaos)

Edit: better yet, save all fields in digiKam and remove the unnecessary ones from the JPG metadata using something like exiftool. That way you won’t mess up with digiKam’s export defaults for the future

digiKam doesn’t have such an export option per se. However, I wonder if I can take what’s in the existing .xmp file and format it in such a way.

If some body can do a dump of a very simple Lightroom keyword file and post it, this would certainly help.

Thank-you for your sage advice, Guillermo. I’ll certainly take heed. I’ve spent years working to extricate myself out of Hierarchical Tag Hell. It would be more than a shame if I end up back where I had started!