[Digikam-devel] [digikam] [Bug 337688] Reading/writing of keyword-tags to jpg and xmp corrupts tag hierarchy, duplicate root tag

Christian buitk14 at A1.net
Mon Aug 18 11:41:32 BST 2014


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

Christian <buitk14 at A1.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #30 from Christian <buitk14 at A1.net> ---
Reason why I want to reopen this bug: The last fix improved tagging a lot, but
there is still an issue related to "zombie tags" that cannot be deleted in 
digikam 4.2.

----------------------------------------------------------------------------

This testcase demonstrates a bug (or several bugs) related to "zombie tags",
that cannot be removed with any of the tools in digikam 4.2 (linux: openSuse).
Even it looks like they are gone, they will come back after reading metadata.
Some only show up again if you excplicitely "read metadata" from the files.

Download Link:
-----------------------------------
http://buitk.at/download/digikam42_zombie_tag_testcase.zip

Pre condition:
-----------------------------------
I cleaned all tags in the files and in the database with dk R4.2 for openSuse
first. Tags were written two times to all files. 

Result: About 30.000 tagged images seem to be clean now, apr. 14.000 are still
infected with old stuff that was not deleted as excpected.
When reading metadata a second time a lot of old tags came to live again. I
removed them again, but finally some show up during writing again.
Only these cases are documented here. 

I install Digikam 4.2 with an empty sqlite database to do the tests described
below.

Testcase and reproducable symptoms:
-----------------------------------

I install Digikam 4.2 with an empty sqlite database and import tags from the
file "00_all_keywords_buitk.jpg".
To do so you have to activate "read metadata from sidecar files". I use "write
tags to files" settings for metadata.

Then I add all images of the folders below to the collection:
  "cannot_remove_tags_from_different_subtree_with_same_leaves"
  "cannot_remove_tags_from_wrong_position"

Then I try to remove the tags that are mentioned in the name of the jpg images.
Example: File
"dsc01931_remove_Zeit-bChr004_Neuzeit_and_1400Spaetmittelalter.jpg"
 ... refers to <toplevel>Zeit/bChr004_Neuzeit/...   and all subsequent tags 
 ... refers to <toplevel>1400Spaetmittelalter

Symptom: Deleted "Zombie Tags" come back
------------------------------------------

Digikam 4.2 can read and write all tagges files now. So the changes are always
written to the images without any error messages.
But in many cases (14.000) the removed tags still remain somewhere in the
written metadata - and not in the database. I have checked this by starting
with an empty database again.
The zombie-tags will show up again if you manually select a single file to read
metadata. Sometimes these zombie tags are created with several copies, if you
select more than one file at a time to read metadata.

Analysis: some hints to track down "why?"
-----------------------------------------
When looking at the cases that still cause troubles in dk4.2 it becomes obvious
that these zombie tags are related to tag-names that are used on more than one
position in the tag tree.
There are several reasons why tag-names are used twice many times in practice:

1. They come from moving tags to another position e.g. if a wrong geographic
classification is corrected, e.g. location is moved to another parent node. 
Note: I will never drag the tag to the new position. A new is created, the old
is deleted.

2. Historical reasons, eg. there was an old subbranch of the time-categories:
Zeit/bChr004_Neuzeit/* with the same leaves like the new one
Zeit/bChr006_Neuzeit/*
Since 2009 I try to get rid of the old Zeit/bChr004_Neuzeit/ branch - with no
luck till today.

3. Many orphan tag nodes come from the "Digikam root tag" bug in older
versions, that caused the loss of one or more levels of nesting.

My guess is that there is a bug in writing, when a tag with the same tag-name
should be removed from one position, but still has to remain in another
position.
NOTE: If you remove all tags manually, all tags will be gone, also the zombies.
These zombies only persist if there is at least another tag around !

Final Note: I also deleted a lot of files with bad tags to get rid of the mess.
Important ones were cleaned using Gimp. But I cannot clean up 14.000 images
this way.

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Digikam-devel mailing list