Bug 463180 - Reread Metadata From File doesn't cleanup Tags
Summary: Reread Metadata From File doesn't cleanup Tags
Status: RESOLVED NOT A BUG
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Keywords (show other bugs)
Version: 8.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-18 04:31 UTC by spiesant
Modified: 2022-12-18 18:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description spiesant 2022-12-18 04:31:43 UTC
SUMMARY

If I add a tag in digiKam, then revert the file, then Reread Metadata from File, digiKam still shows the added tag, even though it is no longer present in the file on disk.  Expectation is that this would bring digiKam's database back in sync with the on-disk data.

STEPS TO REPRODUCE
1) View a jpeg in digikam
2) Make a backup copy of the file somewhere on disk (i.e. from outside of digiKam)
3) In digiKam, add a tag, i.e. "Test". Apply, with metadata writing to file enabled.
4) On disk, replace the file that was tagged by digiKam with the backup (aka "revert the change from backup")
5) In digiKam, select the file & "Reread Metadata from File"
6) digiKam still shows that the photo has the "Test" tag, even though it does not. It is shown in the tags panel on the left, as well as in Captions->Tags panel on the right.

Conclusion: It appears as though "Reread metadata from Files" is not rereading the tags?

OBSERVED RESULT

digiKam still shows the tag, despite it having been reverted on-disk & then having done "reread metadata from files"

EXPECTED RESULT

digiKam should no longer show the tag, as it is no longer present int he jpeg

SOFTWARE/OS VERSIONS
Windows: 7

ADDITIONAL INFORMATION

Tested in digiKam 8.0.0-beta1
Comment 1 Maik Qualmann 2022-12-18 07:34:23 UTC
No, the tag definitely disappears after reading in the metadata again. If writing is activated e.g. for tags, the corresponding database entries are previously cleaned in digiKam-8.0.0. Since I know that you are using 2 digiKam instances, I suspect that you have not enabled tag writing in the reading digiKam instance.
digiKam-8.0.0 only cleans up the database when reading again if writing the relevant metadata is also activated.

Maik
Comment 2 spiesant 2022-12-18 18:14:07 UTC
(In reply to Maik Qualmann from comment #1)
> No, the tag definitely disappears after reading in the metadata again. If
> writing is activated e.g. for tags, the corresponding database entries are
> previously cleaned in digiKam-8.0.0. Since I know that you are using 2
> digiKam instances, I suspect that you have not enabled tag writing in the
> reading digiKam instance.
> digiKam-8.0.0 only cleans up the database when reading again if writing the
> relevant metadata is also activated.
> 
> Maik

This test was done in just one instance, so that's not the issue - but hmm, you're right, it seems like I now am *not* able to repro the issue with just the above steps.

When I observed the behavior, I had done a number of tag adds, and then reverted one file from backup, but couldn't seem to get digiKam to reflect that that the tags had been removed. It was admittedly a longer series of steps that led to that though, which I simplifed to the above. Was sure I'd reproduced it just like that, but in this moment I no longer can, so perhaps it was one of the prior actions that ultimately led to the situation. Anyway, since it seems my steps aren't the proper repro, will close this now. Can always re-report in the event that I see it again & can provide better repro steps. Thanks for the quick replies! :)