https://bugs.kde.org/show_bug.cgi?id=375483
--- Comment #15 from Gernot Hillier <ger...@hillier.de> --- I fixed it manually now in the files as well as in the Digikam database "digikam4.db": 0. Shutdown digikam, backup digikam4.db and photos. 1. Scan all pictures using "exiftool -ImageUniqueId" and find duplicates. A small number of duplicates can come from edited pictures, so only filter out those with many occurences. I used a lot of Samsung phones over the years, so I ended up with this list: "NULL NULL ", "LL ", "OAEL01", "S08Q0LEGC01", "SCEE07", "T13LLIA00PM T13LLIL04SB " 2. Find all problematic images in digikam4.db: select name from Images where id in ( select imageid from ImageHistory where uuid in ("NULL NULL ", "LL ",...) ); Compare this list to files with problematic IDs from step 1. 3. Now I started digikam, and deleted IDs from all those files using "exiftool -ImageUniqueId= <file>". This forces re-read of files in digikam. With digikam >= 5.7, a simple touch shuold be enough, too. Shutdown digikam again. 4. Identify tagid for Digikam's internal tag "Original Version": select id from Tags where name="Original Version"; For me, this was "112". 5. Find all entries for tag "112" in ImageTags for problematic images: select * from ImageTags where tagid=112 and imageid in ( select imageid from ImageHistory where uuid in ("NULL NULL ", "LL ", ...) ) ; Store this result. 6. Verify if some of those images were edited (get file names as in 2., search for name_v?.jpg). If yes, the originals should keep tag "112". 7. Delete all entries with tag="112" and problematic imageid in ImageTags which are not found in 6. (For me, step 6 only returned a small number of files, so I just deleted tag "112" for all Samsung images and added it later again for those who shall have it. 8. Delete all entries in ImageHistory with problematic uuids. Sorry for not sharing a full script here, but I had no time to make a polished version which is sufficiently fool-proof... But if you have some experience using SQL and shell scripts, the above description will hopefully be helpful... -- You are receiving this mail because: You are watching all bug changes.