Bug 446304 - Not all faces are saved when more than one face is confirmed at the same time in a picture
Summary: Not all faces are saved when more than one face is confirmed at the same time...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Maintenance-Faces (show other bugs)
Version: 7.4.0
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-01 00:13 UTC by MarcP
Modified: 2022-10-02 10:00 UTC (History)
3 users (show)

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


Attachments
Being John Malkovich movie poster (101.71 KB, image/jpeg)
2021-12-01 00:14 UTC, MarcP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MarcP 2021-12-01 00:13:39 UTC
SUMMARY
I realized that, when two or more faces are confirmed at the same time in a picture, not all of them are saved (into the metadata and the database). 

It's a weird example, but a picture containing dozens of instances of the same person, when confirming all of them at the same time, only 10-12 of them are really saved. You can try it with the picture I have attached, the poster to the movie "Being John Malkovich".

Moreover, if two or more of these suggestions are confirmed, the other detected faces disappear from the suggestions, and the picture must be scanned again for faces.

I don't know if the same issue happens if two different persons are confirmed at the same time (I don't think it's technically possible in Digikam).


STEPS TO REPRODUCE
1. Scan for faces. Multiple faces are detected in a picture.
2. Confirm all suggestions at once.
3. Open the picture, and observe how many faces were actually saved.

OBSERVED RESULT
Only some of the pictures were actually saved. The rest of the suggestion disappeared.

EXPECTED RESULT
All confirmed suggestion must be saved into the image.

SOFTWARE/OS VERSIONS
Digikam 7.4
Build date: 30/11/21 10:27 (target: Debug)
Rev.: 3d2d9c9df3d9b8940502e89b83d39ce74a335754
In Ubuntu 20.04.3 LTS
Comment 1 MarcP 2021-12-01 00:14:15 UTC
Created attachment 144104 [details]
Being John Malkovich movie poster
Comment 2 Maik Qualmann 2021-12-01 07:14:33 UTC
I cannot reproduce the problem here. Have you activated or deactivated the album monitoring for external changes? 

Maik
Comment 3 MarcP 2021-12-01 16:43:40 UTC
That option is disabled in my setup, but the options "Rescan file when files are modified" and "Clean up the metadata from the database when rescan files" (both under the Metatada section of the Settings) are enabled, which might have something to do.
Comment 4 Per Christian 2022-02-01 11:25:54 UTC
I have the same issue in windows v7.5.0 

Build date: 15.01.2022 15:16 (target: RelWithDebInfo)
Rev.: 49d1402e0106e40cf17a1bf2db59259ce43cbae0
Comment 5 Maik Qualmann 2022-10-01 17:11:57 UTC
Git commit 99ad13aec9f38beded7903899f11e2d36f81c557 by Maik Qualmann.
Committed on 01/10/2022 at 17:10.
Pushed by mqualmann into branch 'master'.

changed tags must be updated immediately in ItemInfo
Further optimization is necessary here, tags should not be
written individually to the metadata, but in one process.
FIXED-IN: 8.0.0

M  +1    -1    NEWS
M  +6    -0    core/utilities/facemanagement/database/faceutils.cpp

https://invent.kde.org/graphics/digikam/commit/99ad13aec9f38beded7903899f11e2d36f81c557
Comment 6 Maik Qualmann 2022-10-02 10:00:31 UTC
Git commit 2c05a357cdc286a67cfed8b84c7df72fa327dbb2 by Maik Qualmann.
Committed on 02/10/2022 at 09:59.
Pushed by mqualmann into branch 'master'.

reorganize writing face tags to files
FIXED-IN: 8.0.0

M  +11   -2    core/libs/fileactionmanager/fileworkeriface.cpp
M  +4    -9    core/utilities/facemanagement/database/faceutils.cpp
M  +0    -1    core/utilities/facemanagement/database/faceutils.h
M  +3    -1    core/utilities/facemanagement/items/facegroup.cpp
M  +1    -0    core/utilities/facemanagement/items/facegroup_p.h
M  +8    -0    core/utilities/facemanagement/workers/databasewriter.cpp

https://invent.kde.org/graphics/digikam/commit/2c05a357cdc286a67cfed8b84c7df72fa327dbb2