Bug 264745 - When adding new tag to multiple images, tags not in common are removed from metadata, though still present in database
Summary: When adding new tag to multiple images, tags not in common are removed from m...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Hub (show other bugs)
Version: 1.9.0
Platform: Compiled Sources Linux
: NOR grave
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-29 14:57 UTC by Elle Stone
Modified: 2017-08-13 15:40 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elle Stone 2011-01-29 14:57:01 UTC
Version:           1.9.0 (using KDE 4.4.5) 
OS:                Linux

When adding a new tag to multiple images (haven't checked for just one image), all tags not shared by the selected images are removed from all selected images. These tags are still in the database and can be restored by synching databases and images. Per http://digikam.1695700.n4.nabble.com/digiKam-ate-my-tags-bug-feature-or-user-error-td3238857.html, this bug seems to have been around for a while. It is also in the digiKam 2 beta.



Reproducible: Always

Steps to Reproduce:
 Select a bunch of images and add a new tag. Open the metadata xmp sidebar and note that all tags not in common to all the selected images are gone. Look at the images thumbs and if you have digiKam configured to show tags, you'll see that the tags are still in the database.



Actual Results:  
When the new tag is written to the image metadata of multiple selected images, all the tags not in common to all images are removed from the metadata, though not from the database.

Expected Results:  
When writing a new tag to metadata of multiple images, the old tags should remain in the metadata as well as in the database. The new tags should be added to the old tags, rather than replace the old tags.

If you are unfortunate enough to assume that having digiKam configured to write metadata to your images is sufficient protection to get tags into images' metadata, and you discard your old database and make a new one, then you just lost all your tags. I lost "who" and "where" tags for 1100 images this way. Fortunately, I had a backup of all the images and so was able to retrieve my lost tags. 

The work-around is to end all tagging sessions with"Tools, 'write metadata to all images'" to restore the removed metadata. Which raises the question of why have digiKam write metadata while tagging, if it needs to be redone at the end of the tagging session.
Comment 1 Vlado Plaga 2011-02-01 12:19:14 UTC
This is a serious issue. I also rebuilt my database a few times from the tags saved in the images, and may have lost tags this way.

I can confirm the loss of tags when adding tags to multiple images, as described in the original bug report.

I also tested adding a new tag to a single image with an existing tag, and the existing tag was preserved.

I checked for the actual tags in the image file(s) with "exiv2 -pi [image]" and "exiv2 -px".

Currently I'm using digiKam 1.2.0 in Debian Squeeze (the release candidate for the next stable Debian release) and digiKam 1.7.0 on Mac OS X. They share one database for tags and ratings (only sharing the thumbnail database was not possible, but that does not matter). I'd like to continue using 1.x digiKam releases for some time (at least until Ubuntu 11.04 is out), and it would be great if someone could also apply the fix to this bug to Debian and Ubuntu distributions that will still be used for years!
Comment 2 caulier.gilles 2011-02-01 12:25:19 UTC
Marcel,

we must to take a look into this file, for next 1.9.0. It's an important issue.

I suspect something wrong in metadatahub, or dmetadata, but i cannot see what's wrong exactly...

Gilles Caulier
Comment 3 Marcel Wiesweg 2011-02-02 22:34:35 UTC
SVN commit 1218563 by mwiesweg:

Take care that we only add and remove keywords, not replace all existing keywords.
(needs some more testing with complex scenarios)

CCBUG: 264745


 M  +14 -8     metadatahub.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218563
Comment 4 caulier.gilles 2011-02-03 09:14:25 UTC
SVN commit 1218608 by cgilles:

backport commit #1218563 from GoSC2010 branch
BUGS: 264745


 M  +14 -8     metadatahub.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218608