Bug 501530 - Removed tags are immediately reapplied
Summary: Removed tags are immediately reapplied
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Faces (show other bugs)
Version: 8.6.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-15 12:27 UTC by Steve Franks
Modified: 2025-04-11 18:13 UTC (History)
2 users (show)

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


Attachments
Debugview Log File (229.97 KB, text/plain)
2025-03-15 12:29 UTC, Steve Franks
Details
JPEG containing "&" (2.36 MB, image/jpeg)
2025-03-26 08:49 UTC, Steve Franks
Details
.xmp file for the JPEG (6.21 KB, text/plain)
2025-03-26 08:53 UTC, Steve Franks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Franks 2025-03-15 12:27:48 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
I'm trying to clear up tags, but when I delete a People Tag it is immediately reapplied to all of the images that it was previously attached to.

STEPS TO REPRODUCE
1.  On the Tags screen, Select a Tag which has face icon.
2.  Select images, then delete the tag. Alternatively remove the tag from images and click on apply to all images.
3.  

OBSERVED RESULT
The tag disappears, then instantly reappears.

EXPECTED RESULT
In versions before 8.6.0 the tag would be permanently removed from the selected images, or deleted if that was the action chosen.

SOFTWARE/OS VERSIONS
Windows:  11 Version 24H2
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version:  6.10.0
Qt Version: Using 6.8.1 and built against 6.8.1

ADDITIONAL INFORMATION
Same issue in digiKam: 8.7.0
Comment 1 Steve Franks 2025-03-15 12:29:39 UTC
Created attachment 179424 [details]
Debugview Log File

Log generated by debugview from digikam start until I stopped the program after this error occured
Comment 2 Maik Qualmann 2025-03-15 13:40:00 UTC
For the sidecars, this name is written as "People/Friends/Anne and Julian McIlroy."

This can also be found in the digiKam TagsList when re-reading after writing. However, it also searches for a candidate for "Anne & Julian McIlroye"; note the "&" as a distinction.
Since it's written in sidecars here, and I don't know the metadata settings, I suspect that more tag metadata is being read, and there may also be face tags in the image itself. Without a sample with sidecars, we can't help here. Just search for the name that shouldn't appear in the metadata viewer in digiKam; the metadata viewer has a search filter. This will help identify the problem.

Maik
Comment 3 Steve Franks 2025-03-18 17:09:47 UTC
The tag with & was first applied many years ago whilst I was using Lightroom to organise my photos. A couple of years ago I decided to remove all ampersands, to avoid any potential problems. Unfortunately whenever I install digikam it seems to read the ancient Lightroom hierarchical subject tags. I have been trying to delete these with Exiftool, but they seem reluctant to let go 😊
I ran digikam appimage again a couple of days after creating this bug report and the tag with “&” has now been deleted. The PC is old and only has 8gb of RAM, but the operating system and digikam database are on an SSD. The photos are on an internal 3TB hard drive.
I’m not sure that this is an issue with face recognition. 
It appeared as though the deletion took place, then the tag and associated images reappeared, but that happened too quickly for me to be sure. Next time I will try to video the deletion.
Comment 4 Maik Qualmann 2025-03-18 17:31:56 UTC
Well, the tags with the "&" character will still be in the images, so a sample would be good to see where they are. Perhaps you've set the Advanced Metadata Settings to read tags from all metadata (it's a checkbox). Normally, digiKam would first read only from the DigiKamTagsList.

Maik
Comment 5 Steve Franks 2025-03-26 08:49:10 UTC
Created attachment 179745 [details]
JPEG containing "&"

This is an example of an image with an ampersand in a field, although that field should not generate a tag.
Comment 6 Steve Franks 2025-03-26 08:53:17 UTC
Created attachment 179746 [details]
.xmp file for the JPEG

This file also has an ampersand in Region Person Display Name:-
  <MP:RegionInfo rdf:parseType="Resource">
    <MPRI:Regions>
     <rdf:Bag>
      <rdf:li
       MPReg:PersonDisplayName="Anne &amp; Julian McIlroye"/>
     </rdf:Bag>
    </MPRI:Regions>
   </MP:RegionInfo>
Comment 7 Maik Qualmann 2025-03-26 09:19:37 UTC
Of course, this name generates the tag from Microsoft Photo Region Info. It's explicitly possible to have a name without a region in the Microsoft Photo Region Info datasheet. We had to support this due to a bug report.

Maik
Comment 8 Steve Franks 2025-03-26 11:16:51 UTC
I'm checking to see whether & appears anywhere else in xmp files.
I deleted all MicrosoftPhoto data, with exiftool. Hopefully deleting MP data will cure this issue
Comment 9 caulier.gilles 2025-04-11 18:13:47 UTC
Hi,

The 8.7.0 pre-release Windows installer from today have been rebuilt from
scratch with Qt 6.8.3, KDE 6.12, OpenCV 4.11 + CUDA support, Exiv2 0.28.5, ExifTool 13.27, ffmpeg 7, all image codecs updated to last version (jxl, avif, heif, aom, etc.).

Please try with this version to see if your problem still reproducible...

https://files.kde.org/digikam/

Thanks in advance
Best regards

Gilles Caulier