Created attachment 148393 [details] Image with a "Barcode" MWG region SUMMARY MWG regions with Type != "Face", i.e., which are not faces, are nevertheless treated as faces. "Type" refers to the tag that exiv2 calls: Xmp.mwg-rs.Regions/mwg-rs:RegionList/mwg-rs:Type STEPS TO REPRODUCE 1. Get some image with a MWG region which has Type != "Face", e.g. attachment. 2. Move into a collection/folder used by Digikam 3. Read its metadata into the database (e.g., trigger a scan for new items, automatically at startup, or Item -> read metadata from image) 4. Rewrite metadata of the image (e.g. Item -> write metadata to image) OBSERVED RESULT The non-face region is treated as a face. This includes Step 3: A facetag with its name is created (if it did not exist before), the region is added there, the region is shown in the preview area and the region participates in face recognition. Step 4: It is erroneously written back to the image metadata with Type == "Face". EXPECTED RESULT The region is not treated as a face (step 3) but is retained, in its original state, whenever the image metadata is written (step 4). Many Thanks!
Git commit 359bfc1bdce248d796893ed8feea459d2d4eb63e by Maik Qualmann. Committed on 26/04/2022 at 20:52. Pushed by mqualmann into branch 'qt5-maintenance'. only accept MWG regions with "Face" as type FIXED-IN: 7.7.0 M +2 -1 NEWS M +24 -14 core/libs/metadataengine/dmetadata/dmetadata_faces.cpp https://invent.kde.org/graphics/digikam/commit/359bfc1bdce248d796893ed8feea459d2d4eb63e
Dear Maik, thanks you and sorry if that should go into a new bug report, or not at all. Unfortunately that fix removes all non-face regions if the metadata is rewritten. I tested that with the latest appimage (digiKam-7.7.0-20220427T043335-x86-64.appimage). Many Thanks! Paul For what I understand from the source code and might suggest: The problem is in DMetadata::setItemFacesMap at // Remove face metadata before writing new ones to prevent problems (bug 436286). removeItemFacesMap(); This unconditionally removes the whole Xmp.mwg-rs.Regions/mwg-rs:RegionList tag, but there is no copy of the non-face regions in the database, memory or somewhere else. So either one of the following should be a fix: A) Read all non-face regions from the image metadata before removeItemFacesMap and write them to the image metadata afterwards. B) Save the non-face regions too in the database (just not as faces) and write them to the image metadata after removeItemFacesMap. C) Instead of unconditionally removing the whole Xmp.mwg-rs.Regions/mwg-rs:RegionList tag with removeItemFacesMap, remove just the regions with Type == "Face". (I do not know if this conflicts Bug 436286. But, for example, the writing of AppliedToDimensions has to be changed, probably.) For either of that, probably the code which checks if the RegionList tag is empty, and should be deleted, or should not be written at all, needs an update too.
Git commit 4881ccee0ec4f9af1031c1935503c46582c317c3 by Maik Qualmann. Committed on 27/04/2022 at 17:19. Pushed by mqualmann into branch 'qt5-maintenance'. revert "only accept MWG regions with "Face" as type" M +1 -1 NEWS M +0 -8 core/libs/metadataengine/dmetadata/dmetadata_faces.cpp https://invent.kde.org/graphics/digikam/commit/4881ccee0ec4f9af1031c1935503c46582c317c3
Paul, What's about this file using current 8.2.0 AppImage Linux bundle ? It's reproducible ? https://files.kde.org/digikam/ Thanks in advance Gilles Caulier
Still reproducible. Please see comment 1 and 2 for how to fix.