Bug 374470 - Deleted tags are not removed from file metadata
Summary: Deleted tags are not removed from file metadata
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Engine (show other bugs)
Version: 5.4.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-02 22:43 UTC by Simon
Modified: 2018-03-27 21:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2017-01-02 22:43:17 UTC
Steps to reproduce:
1. Enable writing image tags to metadata (either with or without lazy sync).
2. Create a tag and apply it to one file.
3. Delete this tag in the right tag sidebar.
4. Confirm the prompt warning that this tag is assigned to one item.
5. Reread metadata from file.

Expected results:
The deleted tag stays deleted.

Actual results:
The deleted tag is resurrected and shown as applied to the test image.

This is not https://bugs.kde.org/show_bug.cgi?id=361378 as the tag is correctly removed from the file when it is explicitly removed for just that file. This only occurs on deletion of the tag itself.

The documentation states:
    You can delete a tag by right-clicking on the tag you want to delete and
    selecting Delete Tag. When you delete a tag, the photographs themselves are
    not deleted. Simply the tag is removed from those photographs.

This is currently only true for the database, not for the image metadata.
Comment 1 Simon 2017-01-04 09:25:24 UTC
Can someone please confirm that the behaviour described earlier and in
documentation is indeed the intended behaviour?
I just want to make that sure before I look into it.

In short: Tags should be removed from file metadata when the tag itself
is deleted.
Comment 2 Mario Frank 2017-01-07 10:20:51 UTC
Hey Simon, 

I will take a look at the code. There are some spots in digikam where the deletion of some structure dies not lead to the deletion of related opposing to the intuition or documentation.

But can you first check if the tag is deletion from metadata if you sync the metadata to file?
Comment 3 caulier.gilles 2017-01-07 10:52:36 UTC
Mario, Frank,

The Metadata workflow is complex and relevant of multiple classes in digiKam, mostly hosted in core/libs/dmetadata. The class which do the stuff to route metadata from/to image/database is basically MetadataHub. But it's not the only this one.

For 5.0.0 we introduce a new Advanced Settings panel written by a GoSC student. The goal was to make a wrapper for all metadata tags to populate DB and forward later to image file.

For this component, which goal MetadataHub workflow, the first implementation was not enough and a second GoSC with the same student was planed, but for personal reasons, the student was not able to work one year more.

He left a very good documentation explaining the first work completed and the second one not yet done. I will share this doc through GDoc.

Gilles Caulier
Comment 4 Maik Qualmann 2018-03-27 21:20:45 UTC
Git commit f748bdaa1015277e2c082c94b36dcaba48a38f76 by Maik Qualmann.
Committed on 27/03/2018 at 21:03.
Pushed by mqualmann into branch 'master'.

write metadata to images after move, rename or delete tags,
we ask the user if > 100 images are affected
Related: bug 386224
FIXED-IN: 6.0.0

M  +3    -1    NEWS
M  +69   -2    core/libs/album/albummanager.cpp
M  +5    -1    core/libs/album/albummanager.h
M  +2    -2    core/tests/albummodel/albummodeltest.cpp

https://commits.kde.org/digikam/f748bdaa1015277e2c082c94b36dcaba48a38f76