Synching Digikam tags back into Darktable

Once I have processed a raw image with darktable, I export to jpg format and store on disk in a hierarchy of folders organised by date and trip location. I then use digikam to review the images, giving a star rating and tagging with extra information such as precise location, and for wildlife the name and species group.

What I would like is a way to copy the rating and tagging information from the jpg file back to the raw file. exiv2 or exiftool can extract the rating information and raw filename from the jpg, and probably, with a bit of scripting, write the information into the raw file xmp. However, with thousands of images in dozens of subfolders it would be tricky to create a reliable batch process.

So my real question is whether there are any tools inside digikam or darktable that would make the job easier, or does anyone have a script already?

How would I use this? Well I could save a lot of disk space if I could selectively delete all raw files containing poor quality images - even with the latest darktable advances, its rarely worth fiddling with rubbish in the hope of finding a gem. A rough and ready calculation (including backups) shows that I could clean up 1Tb of storage - worth it if there is a good way to automate things.

I’m wondering why you review the image after you spent time importing, editing, and tagging photos in Darktable. Why not doing that before exporting, and in fact directly when you import them in Darktable. It will be faster sorting them out and deleting poor quality RAWs.
Also without exporting edited photos, darktable saves all edits, tags, gps in a xmp sidecar file. This file is there because you are not supposed to alter RAW files.

My question is why do you want to alter raw files in the first place ?

Good questions!

Firstly, you are right, I should put some kind of rating on each picture in Darktable, and probably will in future. But the fact remains, that I didnt do this for a couple of thousand old pictures.

Secondly, I find Digikam much better for reviewing lots of photos, probably because flicking from 1 jpg to the next is almost instantaneous.

Thirdly, for wildlife pictures, I tend to take multiple shots hoping to catch the bird or animal in focus and well posed. Very often I get just a couple of seconds of opportunity. This means that I might have a dozen or more photos of a particular bird across a couple of days and locations. What is worse, I need to actually identify the creature correctly. This can be easy if there was a guide telling me what it was, but often there was a lot going on and I need to flick back and forth between several views of the same creature, trying to pick out some distinctive feature to match against books or web pages.

Once I have identified and tagged all the images, I go through and look more carefully. In many cases, particularly with birds, I will review the best images of a bird and go back into darktable to spend some more time enhancing, and rerating. In some cases, we saw a really rare/special bird but only got rubbish photos. In that case I want to keep at least one photo “for-the-record” even if its a no-star rating.

In summary, I need to use Digikam’s tagging power to best decide if a raw image is worth keeping. To answer your second question - I only want to change the xmp sidecar so that I can use darktable to bulk select all the files to delete from disk - this would save me a terabyte of storage, but allow me to revisit the “good” raw files if I need to, or if Aurelien comes out with a new piece of magic.

Ideally I would go to a Digikam folder, select all the jpg images rated 2 stars or lower, then find a way to mark and delete the coresponding raw files.

Thank you for your workflow.

I see Darktable is only use for ratings… you do 99% of your selection/sorting in Digikam. And it seems Digikam is the best at it. Is there no way in Digikam to do the rating instead ? It would be way more streamlined and faster.
But instead of rating you could use tags. You could mimcs ratings with 1,2, 3 star tags. And only the one with the 3 star tags gets imported into Darktable. 1 and 2 stars gets deleted by digikam.

Actually I use darktable for the full process of developing the raw image.

This normally starts with cropping down to the bird, then picking out as much detail as I can. With a couple of thousand shots from a 10 day trip, it makes sense to sweep through in darktable so that I get a good clean image of the bird I was trying to photograph: Darktable far exceeds digikam in processing raw images.

Only then do I export to Digikam for identification, tagging, long term storage etc.

I also prefer to use digKam for photo management, too, but I use RawTherapee instead of darktable. I tried the latter some time ago and if I remember correctly, darktable and digiKam did not work well together. I even lost metadata and sidecar files because darktable overwrote them. Maybe that changed in the meantime. Is writing metadata into raw files an option? I’m not sure if darktable processes them correctly.

Another idea is to use the group function of digiKam. You can group according to date and all jpg and raw files with the same date will be grouped. Then, you can tag the groups in one go.