Bug 434438

Summary: Writing metadata to an XMP sidecar removes previously-entered metadata already in the XMP file.
Product: [Applications] digikam Reporter: james
Component: Metadata-SidecarAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 7.2.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 8.2.0
Sentry Crash Report:

Description james 2021-03-15 13:27:46 UTC
SUMMARY

Adding a caption to a photo and writing metadata to an XMP sidecar file removes any tags that might already be recorded in the XMP sidecar.

STEPS TO REPRODUCE
1. Set Digikam to "Write to XMP sidecar only"
2. Find a photo with no tags or captions.
3. Open the "Captions" right-hand panel and click the Tags tab.
4. Add a tag and click "Apply"
5. An XMP sidecar file is generated, with a <digiKam:TagsList> element.
6. Click the Description tab.
7. Add a caption and click "Apply"
8. An XMP sidecar file is generated, *only* containing the caption. The tag information is now missing from the XMP file.

EXPECTED RESULT

I expect that whenever Digikam writes an XMP sidecar file, it writes all eligible metadata, whereas it appears to be writing only the latest change.


SOFTWARE/OS VERSIONS
KDE Frameworks 5.73.0
Qt 5.14.2 (built against 5.14.2)
The xcb windowing system

Running Digikam version 7.1.0 AppImage on Ubuntu 20.04.02 LTS.
Comment 1 james 2021-03-15 13:28:55 UTC
Noting that choosing "Item > Write Metadata to File" correctly writes all metadata to the XMP sidecar file.
Comment 2 caulier.gilles 2021-03-15 14:32:03 UTC
Please test with 7.2.0 pre-release AppImage bundle available here :

https://files.kde.org/digikam/

Note : backup your database file before to use 7.2.0, just to be safe.

Gilles Caulier
Comment 3 james 2021-03-15 14:56:40 UTC
I re-tested using digiKam-7.2.0-20210312T180628-x86-64.appimage using a completely fresh database (installed under a different user) with a single photo. The issue is still present.
Comment 4 Maik Qualmann 2021-03-15 17:37:28 UTC
Hmm, the cause is clear, you should actually also enable reading of metadata from sidecars.
Editing in the sidebar reads the information from the metadata (image and sidecar) into the container and then writes the new metadata into the sidecar. If reading the sidecar is not activated, only the content of the metadata of the image is written back the next time it is written. In digiKam with a database, we would also have to merge the metadata with the database if reading from sidecar disabled.

Maik
Comment 5 Maik Qualmann 2021-03-15 17:38:16 UTC
I'm sure we already have a bug report on it.

Maik
Comment 6 Maik Qualmann 2021-03-15 17:57:20 UTC

*** This bug has been marked as a duplicate of bug 395914 ***
Comment 7 caulier.gilles 2023-10-18 09:58:17 UTC
Fixed with 395914