How can I make Darktable reload updated XMP metadata from digiKam?
Asked 6/13/2017
9 views
2 answers
0
I use Darktable alongside digiKam and other editors. After importing RAW files into Darktable, I later changed the caption/comment metadata in digiKam and wrote it to XMP sidecars. Darktable kept showing the old metadata, even after removing images from the collection and rescanning the folder.
How can I get Darktable to pick up metadata changes made by another program after the images were already imported? Is there a specific setting in digiKam or Darktable that allows reloading updated XMP sidecars without losing existing Darktable edits?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
9y ago
2 Answers
2
I've been doing some experimenting and it seems that the basic problem is with the way I was using digiKam.
In Configure - digiKam / Metadata / Behaviour there are several settings for reading and writing metadata. The really important one is : Update file timestamp when files are modified. Without this darktable doesn't know that the file has altered and will not prompt you to update the database with the "reload selected xmp files" button in the "updated xmp sidecar files found" dialogue box at start up.
Further findings from my experiments....
In the end I turned all the options on in Configure - digikam / Metadata / Behaviour and set "Write to sidecar files" to "Write to image and XMP sidecar", even though darktable really only interacts with the XMP file once it has been created. I guess this is an insurance against corrupting your image file.
digiKam has a setting in Configure - digikam / Metadata / Behaviour "If possible write Metadata to RAW files (experimental). Using Captions / Tags Description and Information tabs worked with title, caption, author, name, position and copyright all being recorded. However when I tried using the Image / Metadata / Edit All Metadata command my 10.7 MiB .ORF file was corrupted to 21.8 KiB, presumably all the image data is lost. This happens even when I try to edit only one item with all other checkbox's cleared.
When checking the .ORF files in Olympus Viewer which I had altered in digiKam, the only fault I can find is that the Lens Information which should read something like OLYMPUS 11-22mm F2.8-3.5 is messed up with a series of unreadable characters. This seems to be the Lens Model makernote, which digiKam displays correctly and darktable ignores preferring the Lens Type makernote (which reads "Olympus Zuiko Digital 11-22mm F2.8-3.5").
This may be due to the sync settings and certain fields being limited to a finite number of ASCII characters or the corruption of the makernotes.
digiKam uses exiv2 and their site Exiv2.org suggests that the closed, proprietary format of exif makernotes means that any change of an exif tag could move the makernotes field and corrupt it. Phil Harvey's Exif Tool site explains that the default behaviour of his metadata editing software is to work on a copy because of the complexities involved.
On the digiKam site digiKam Configuration a to do is described which will enable users to direct where digikam stores / retrieves tags ratings and comments.
I also found that I could use darktable's lighttable - import - image on a file already in the database to force an update, though this only seems to work once and then crashes darktable the next time you click on the button. Darktable's lighttable - import - folder does the same.
Finally, here are the locations that the software is writing data to.
When using the digiKam / Captions/Tags / Description tab:
Title is written to:
- IPTC : Object Name
- XMP : caption
- XMP : Title
Captions is written to:
- Exif : Image Description
- Exif : User Comment
- IPTC : Caption
- XMP : notes
- XMP : Description
- XMP : User Comment
- XMP : Image Description
Caption Author is written to:
- XMP : author
- XMP : Captions Author Names
When using digiKam / Captions/Tags / Information / Rights tab:
Names is written to:
- Exif : Artist
- IPTC : By-line
- XMP : Creator
- XMP : Artist
Position is written to:
- IPTC : By-line Title
- XMP : Authors Position
Copyright is written to:
- Exif : Copyright
- IPTC : Copyright
- XMP : Rights
- XMP : Copyright
When using darktable / lighttable / metadata editor:
Title is written to:
- IPTC : Object Name
- XMP : Title
Description is written to:
- Exif : Image Description
- IPTC : Caption
- XMP : Description
Creator is written to:
- Exif : Artist
- IPTC : By-line
- XMP : Creator
Publisher is written to:
- XMP : Publisher
Rights is written to:
- Exif : Copyright
- IPTC : Copyright
- XMP : Rights
Note darktable only writes this to the sidecar .XMP file and embeds it in any exported files processed from the RAW. digiKam can read this information and embed the data in the RAW image metadata by using Image / Reread Metadata from Image to update the database then Image / Write Metadata to Image to embed it. However this means the data is in actual fact written to more places.
Title is written to:
- IPTC : Object Name
- XMP : Title
- XMP : caption
Description is written to:
- Exif : Image Description
- Exif : User Comment
- IPTC : Caption
- XMP : notes
- XMP : Description
- XMP : User Comment
- XMP : Image Description
Creator is written to:
- Exif : Artist
- IPTC : By-line
- XMP : Creator
Publisher is written to:
- XMP : Publisher
Rights is written to:
- Exif : Copyright
- IPTC : Copyright
- XMP : Rights
UPDATE:
Darktable's behavior appears to have changed. Currently on v3.0.2 the metadata editor in lighttable view writes the following meta data to exported jpg's. 
Title is written to:
- xmp.dc.title
Description is written to:
- Exif.Image.ImageDescription
- Xmp.dc.description
Creator is written to:
- Exif.Image.Artist
- Xmp.dc.creator
Publisher is written to:
- Xmp.dc.publisher
Rights is written to:
- Exif.Image.Copyright
- Xmp.dc.rights
A new feature in the export tab (accessed through the cog icon next to the export button is the "edit metadata exportation" dialogue. A bit of a mouth full but a powerful tool none the less, this dialogue allows you to override the metadata editor which when combined with export presets allows the user to create different export settings for different file uses.
[

Now the jpeg contains the metadata as set in the export dialogue, though notice how the xmp.dc.creator and xmp.dc.publisher entries have been appended. I believe this is because multiple instances are allowed (gnome image viewer list these as XMP IPTC - dc:creator[1], XMP IPTC dc:creator[2], etc).
If the general settings in "edit metadata" are all switched off the metadata is presented as shown in the dialogue, but almost nothing else is included (no camera settings, creation date or time and so on). 
note I haven't searched darktable to narrow down tab results this time.
The power of this feature comes in when you use it on a redefined tag with no formula (1), text (2) or one or more of the darktable variables (3). Using no formula prevents output of the meta tag and the variables are listed in the manual pdf (there are more than shown in the hint text). 


Originally by user60903. Source · Licensed CC BY-SA 4.0
user60903
9y ago
0
Generated from our catalog & community — verify before relying on it.
Yes. Darktable stores image data in its own database after import, so later metadata changes made by other software won’t automatically appear unless Darktable detects that the XMP sidecar has changed.
From the shared findings, the key issue was digiKam not updating the file timestamp when metadata was modified. If the timestamp doesn’t change, Darktable won’t notice the sidecar update and won’t offer to reload it.
What helped:
- In digiKam, enable metadata writing to XMP sidecars.
- Turn on the option to update the file timestamp when files are modified.
- In Darktable, enable the preference to look for updated XMP files on startup.
- When Darktable detects changed sidecars, use the prompt to reload the selected XMP files.
That lets Darktable refresh metadata from the sidecars without deleting your existing XMP files or losing your edits. In short: make sure digiKam writes the metadata change to the sidecar and updates the modification time, then let Darktable reload the changed XMP on startup.
Recommended products
UniqueBot
AI9y ago
Your Answer
Related Questions
How can I rescan folders in Darktable to detect new or removed photos?
Can digiKam ratings be used to filter photos in RawTherapee?
How can I restore darktable edits from existing XMP sidecar files after moving to a new computer?
Should I import Photoshop composites into Lightroom or manage them in Bridge?
How can I delete rejected photos from disk in Darktable?

