Describe the bug
When I update tags within XMP sidecar files in another application (eg. Digikam), darktable does not appear to update its database even though I select "update datebase from selected xmp files" within the "updated xmp sidecar files found" dialog when starting darktable.
This is also reproducible without another application. See steps below.
To Reproduce
A pre-requisite is that both Digikam and darktable have their own libraries generated from the images in the same folder. I created the Digikam library first (no XMP files were created or existed). I then created darktable's library on the same folder, which created XMP files for each image. darktable is configured to look for updated XMP files on start. Digikam is configured to read and write XMP sidecar files. For tags in particular, Digikam is configured to read and write both Xmp.dc.subject and Xmp.lr.hierarchicalSubject.
- Ensure both Digikam and darktable are closed.
- In Digikam, select a photo and add two tags.
- Close Digikam. At this time, I confirm the tags are in both sections of the XMP file noted above.
- Open darktable
- At the "updated xmp sidecar files found" dialog, select the row and click "update database from selected xmp files".
- darktable does the right thing and imports the two tags.
- Close darktable
- Open Digikam
- Select the same image
- Remove one of the tags and select Apply
- Close Digikam. At this time, I confirm that both sections of the XMP file contain the one tag.
- Open darktable
- At the "updated xmp sidecar files found" dialog, select the row and click "update database from selected xmp files".
- darktable continues to show two tags.
- Close darktable
- The XMP sidecar file has both tags in both sections.
An alternative way to reproduce without another application:
- Open darktable
- Assign two tags to an image
- Close darktable
- Edit the XMP sidecar file (using vi or similar editor) and remove one of the tags from both Xmp.dc.subject and Xmp.lr.hierarchicalSubject sections
- Open darktable
- At the "updated xmp sidecar files found" dialog, select the row and click "update database from selected xmp files".
- darktable continues to show two tags
- Close darktable
- The XMP sidecar file has both tags in both sections.
It appears that darktable didn't update the database. It certainly updated the XMP files when it shouldn't have.
Expected behavior
darktable should update the database with the new XMP sidecar file content. In the case above, the darktable database should have been updated to reflect one tag and should not have written the 2nd tag back to the XMP file.
Screenshots
Let me know if needed
Platform (please complete the following information):
- Darktable Version: 3.0.2
- OS: Manjaro Linux
- OpenCL activated
- Asus GTX Strix 1660 Super. Nvidia proprietary drivers.
Additional context
All packages have been installed from the Manjaro repo (nothing compiled by me).
Sample XMP:
<?xml version="1.0" encoding="UTF-8"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:MicrosoftPhoto="http://ns.microsoft.com/photo/1.0/"
xmlns:acdsee="http://ns.acdsee.com/iptc/1.0/"
xmlns:exif="http://ns.adobe.com/exif/1.0/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:lr="http://ns.adobe.com/lightroom/1.0/"
xmlns:darktable="http://darktable.sf.net/"
MicrosoftPhoto:Rating="0"
acdsee:rating="0"
exif:ApertureValue="196608/65536"
exif:ColorSpace="1"
exif:CustomRendered="0"
exif:DateTimeOriginal="2020:01:26 21:22:42"
exif:ExifVersion="0230"
exif:ExposureBiasValue="0/1"
exif:ExposureMode="0"
exif:ExposureProgram="3"
exif:ExposureTime="1/160"
exif:FNumber="28/10"
exif:FlashpixVersion="0100"
exif:FocalLength="50/1"
exif:FocalPlaneResolutionUnit="2"
exif:FocalPlaneXResolution="5184000/907"
exif:FocalPlaneYResolution="3456000/595"
exif:MeteringMode="5"
exif:PixelXDimension="5184"
exif:PixelYDimension="3456"
exif:SceneCaptureType="0"
exif:ShutterSpeedValue="483328/65536"
exif:WhiteBalance="0"
photoshop:DateCreated="2020-01-26T21:22:42.92"
tiff:Compression="6"
tiff:ImageLength="3456"
tiff:ImageWidth="5184"
tiff:Make="Canon"
tiff:Model="Canon EOS 7D"
tiff:Orientation="1"
tiff:ResolutionUnit="2"
tiff:XResolution="72/1"
tiff:YResolution="72/1"
xmp:CreateDate="2020-01-26T21:22:42.92"
xmp:ModifyDate="2020-01-26T21:22:42.92"
xmp:Rating="0"
xmpMM:DerivedFrom="IMG_1229.CR2"
darktable:xmp_version="3"
darktable:raw_params="0"
darktable:auto_presets_applied="0"
darktable:history_end="0"
darktable:iop_order_version="0">
<exif:ComponentsConfiguration>
<rdf:Seq>
<rdf:li>1</rdf:li>
<rdf:li>2</rdf:li>
<rdf:li>3</rdf:li>
<rdf:li>0</rdf:li>
</rdf:Seq>
</exif:ComponentsConfiguration>
<exif:Flash
exif:Fired="True"
exif:Function="False"
exif:Mode="1"
exif:RedEyeMode="False"
exif:Return="0"/>
<exif:ISOSpeedRatings>
<rdf:Seq>
<rdf:li>1250</rdf:li>
</rdf:Seq>
</exif:ISOSpeedRatings>
<tiff:BitsPerSample>
<rdf:Seq>
<rdf:li>8 8 8</rdf:li>
</rdf:Seq>
</tiff:BitsPerSample>
<dc:subject>
<rdf:Bag>
<rdf:li>tag1</rdf:li>
<rdf:li>tag2</rdf:li>
</rdf:Bag>
</dc:subject>
<lr:hierarchicalSubject>
<rdf:Bag>
<rdf:li>tag1</rdf:li>
<rdf:li>tag2</rdf:li>
</rdf:Bag>
</lr:hierarchicalSubject>
<darktable:masks_history>
<rdf:Seq/>
</darktable:masks_history>
<darktable:history>
<rdf:Seq/>
</darktable:history>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
Describe the bug
When I update tags within XMP sidecar files in another application (eg. Digikam), darktable does not appear to update its database even though I select "update datebase from selected xmp files" within the "updated xmp sidecar files found" dialog when starting darktable.
This is also reproducible without another application. See steps below.
To Reproduce
A pre-requisite is that both Digikam and darktable have their own libraries generated from the images in the same folder. I created the Digikam library first (no XMP files were created or existed). I then created darktable's library on the same folder, which created XMP files for each image. darktable is configured to look for updated XMP files on start. Digikam is configured to read and write XMP sidecar files. For tags in particular, Digikam is configured to read and write both Xmp.dc.subject and Xmp.lr.hierarchicalSubject.
An alternative way to reproduce without another application:
It appears that darktable didn't update the database. It certainly updated the XMP files when it shouldn't have.
Expected behavior
darktable should update the database with the new XMP sidecar file content. In the case above, the darktable database should have been updated to reflect one tag and should not have written the 2nd tag back to the XMP file.
Screenshots
Let me know if needed
Platform (please complete the following information):
Additional context
All packages have been installed from the Manjaro repo (nothing compiled by me).
Sample XMP: