SUMMARY: If digiKam saves a heirarchical tag to the Extended Attributes, the tag is saved as a list of tag components STEPS TO REPRODUCE: On a system that supports Extended Attributes (such as Ext4, BTRFS) Tell digiKam that it should handle extended attributes, go to "Settings / Configure digiKam / Metadata / Baloo" and set: Store metadata from digiKam in Baloo Read metadata from Baloo and under "... / Metadata / Behaviour / Write this information to the Metadata", select: Image tags Rating and also under "... / Metadata / Behaviour / Reading and Writing Metadata", select: Update file modification timestamp when files are modified Rescan file when files are modified Clear the selections under "... / Metadata / Advanced" for Tags and Ratings, on the basis that this is needed in order to write the tag/rating metadata back to the Extended Attributes Create new test image, run digiKam and assign a tag "Parenttag/Mytag" to it (did this via "Captions", typing in the Tag in the "Tags" tab and saying the tag should be created under "/BalooTags") Check the tag as written to the filesystem: getfattr -d testfile.jpg OBSERVED RESULTS The tags are shown as two separate, rather than hierarchical tags # file: testfile.jpg user.xdg.tags="Mytag,ParentTag" EXPECTED RESULTS A hierarchical tag is saved: # file: testfile.jpg user.xdg.tags="Parenttag/Mytag" SOFTWARE/OS VERSIONS Neon Unstable DigiKam : 7.2.0 (build date 2021-03-05) Plasma : 5.21.80 Frameworks : 5.80.0 Qt : 5.15.2 Filesystem : Ext4 ADDITIONAL INFORMATION A connected issue is that hierarchical tags read from the Extended Attributes are only partially written back when saved; "Parenttag/Mytag" is written back as "Mytag" and this overwrites the original xattr info
Git commit 7e9deba251739bcd3b2786e7c63eb8ad1556a24f by Maik Qualmann. Committed on 05/03/2021 at 11:45. Pushed by mqualmann into branch 'master'. write hierarchical tags to Baloo FIXED-IN: 7.2.0 M +2 -1 NEWS M +5 -5 core/libs/fileactionmanager/metadatahub.cpp M +3 -10 core/utilities/extrasupport/filesindexer/baloowrap.cpp https://invent.kde.org/graphics/digikam/commit/7e9deba251739bcd3b2786e7c63eb8ad1556a24f
Checked with build 2021-03-06 That works so much better. I can see two changes, hierarchical tags I create within digiKam are written as hierarchical tags to the extended attributes - so I see: # file: testfile.jpg user.xdg.tags="Parenttag/Mytag" I can set these tags in Dolphin/Gwenview, read them into digiKam and write them out and it works. A "full circle" test works. I also notice that when digiKam reads the Extended Attribute Tags, they appear 'as given' in the Tag view, not prefixed by /BalooTags. I also do not need to create a new Tag under /BalooTags in order for it to be exported to the xattrs. For me, that is a real improvement. Many thanks! There might be an edge case when someone deletes tags within digiKam and expects the tags to be cleared when written to the xattr. Can check and log this as a separate issue
(In reply to tagwerk19 from comment #2) > There might be an edge case when someone deletes tags within digiKam and > expects the tags to be cleared when written to the xattr. Can check and log > this as a separate issue See bug 434060