Bug 309243 - Reread metadata does not remove tags from database
Summary: Reread metadata does not remove tags from database
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Hub (show other bugs)
Version: 4.10.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-30 10:00 UTC by b3nmore
Modified: 2017-08-13 07:47 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description b3nmore 2012-10-30 10:00:23 UTC
I've noted this problem, because I sync my image files between two machines via rsync and changes in metadata made on one machine are only partially reflected by digikam on the other machine.
The only solution I found yet, is to force digkam to rebuild its db by deleting it.

Reproducible: Always

Steps to Reproduce:
1. Take an image with tags known to digikam
2. Remove a tag outside of digikam (e.g. digikam on a different machine) from the image.
3. Reread the metadata of this image in digikam.
Actual Results:  
The metadata viewer shows that the tag indeed has been removed. But the whole tag infrastructure of digikam (filter, view by tag, etc.) still links this tag to the image.

Expected Results:  
Reread should update digikams db not only when a tag is added, but also when it is removed.

What I would like to see: If an image time stamp has changed (e.g. because the metadata has been modified), digikam should detect this upon startup and reread the metadata (and update the db) automatically.
Comment 1 caulier.gilles 2014-09-02 10:22:53 UTC
Veaceslav,

What's about this file for next 4.3.0 ? It's already fixed ?

Gilles
Comment 2 Veaceslav Munteanu 2014-09-02 10:39:57 UTC
I will mark this one as duplicate, since this bug report:

https://bugs.kde.org/show_bug.cgi?id=337688

have a lot more testcases and covers more problems and I also did a lot of work on it.

Please post your comments there, if you can reproduce some bugs related to read/write metadata

*** This bug has been marked as a duplicate of bug 337688 ***
Comment 3 b3nmore 2015-05-29 11:33:55 UTC
I find this still to be an issue in digikam 4.10. Since the other issues from bug 337688 have been solved I'm reopening this one.
Comment 4 Maik Qualmann 2015-05-30 19:35:56 UTC
By programming it is easy to remove all tags, but not all users write their tags in the metadata of image. A rereading of metadata would all tags delete in the DB. Also I have tags only in the DB, I know, at loss the DB were tags in the metadata of images of advantage. Optional by a setting in the metadata settings could be a solution.
Current Status:
Rating, color and pick tags only be changed or removed if valid data exist in the metadata of image. Keyword tags are added only new.

Maik
Comment 5 b3nmore 2015-05-31 06:49:33 UTC
Adding a settings option to keep the db in sync with image metadata would be highly appreciated. 

IMO this would be useful in many cases like backups, sharing pictures between different machines or working with different programs on the same set of pictures. Additionally right now it is hard to tell, if a keyword tag is in the image metadata or only in digikams db.
Comment 6 Veaceslav Munteanu 2015-06-01 17:26:05 UTC
So, with this commit I implemented "Remove Unused Tags" in Tags Manager

http://quickgit.kde.org/?p=digikam.git&a=commit&h=6943606fa92404c296c23a8982df47339dc4164e

since it was a similar report:
https://bugs.kde.org/show_bug.cgi?id=348105

I suggest to re-read metadata and then, just call Remove Unused Tags and you have the desired result.

This option is quite dangerous and I will perform some tests tomorrow.
Comment 7 caulier.gilles 2015-06-03 08:59:20 UTC
Git commit 727514c264edae32a55f8b99a627047a521d0177 by Gilles Caulier.
Committed on 03/06/2015 at 08:58.
Pushed by cgilles into branch 'frameworks'.

backport commit #6943606fa92404c296c23a8982df47339dc4164e from git/master to frameworks branch
Related: bug 348105

M  +123  -1    libs/tags/tagsmanager/tagsmanager.cpp
M  +4    -0    libs/tags/tagsmanager/tagsmanager.h

http://commits.kde.org/digikam/727514c264edae32a55f8b99a627047a521d0177