Bug 448789 - Face region is erased when people tag is removed [patch]
Summary: Face region is erased when people tag is removed [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Pick (other bugs)
Version First Reported In: 7.5.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-19 19:17 UTC by José Oliver-Didier
Modified: 2022-01-20 11:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 7.6.0
Sentry Crash Report:


Attachments
notdeletefaces.patch (2.29 KB, patch)
2022-01-19 22:39 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description José Oliver-Didier 2022-01-19 19:17:03 UTC
SUMMARY
Face Region is erased when people tag assigned to that face region is removed.


STEPS TO REPRODUCE
1. Assign a face region and people tag to the region for a photo A.
2. Go to thumbnail view and open the "Captions" right side pane and select "Tags" tab.
3. From the side pane, unselect the People tag for photo A which was added in Step 1.
4. Open photo A to view/edit face regions.

OBSERVED RESULT
- People Tag in photo A is erased along with the face region. 

EXPECTED RESULT
- People Tag should be removed/unassigned to photo, but face region should remain empty - instead assigned to "Unknown".

SOFTWARE/OS VERSIONS
Windows 11
Comment 1 Maik Qualmann 2022-01-19 22:39:43 UTC
Created attachment 145654 [details]
notdeletefaces.patch

Not tested enough yet, so a patch first.

Maik
Comment 2 caulier.gilles 2022-01-20 10:29:33 UTC
Hi Maik,

Regarding the patch, the logic sound good for me. 

The only small improvement to do, perhaps, is to fork the loops to a separate thread. As i see that application cursor is turned to pending task, I suppose that loops can take a while if more than one faces must be processed and if the database is busy or access is slow due to network.

Using QFuture/QtConcurrent::run() is the most easy way to do, without to cut loops as parallelized future calls, else concurrent access to the database will happen. A simple function called in a separated thread can be enough to not block the whole GUI.

Gilles
Comment 3 Maik Qualmann 2022-01-20 11:43:39 UTC
Hmm, I took the wait cursor from the merge function, I added it there. It's a database only operation, I added it because I can't estimate how long it will take. I don't know if a thread here will help us as we'll have to wait for the completion anyway and only then can we actually delete the tags. I'll commit the current status first, we'll see if there's any feedback.

Maik
Comment 4 Maik Qualmann 2022-01-20 11:47:02 UTC
Git commit e323f623318cc69bd1e1e250e5d8c5eb074da6b6 by Maik Qualmann.
Committed on 20/01/2022 at 11:45.
Pushed by mqualmann into branch 'master'.

reset the face region to unknown when the person tag is deleted
FIXED-IN: 7.6.0

M  +1    -1    NEWS
M  +46   -8    core/libs/album/manager/albummanager_talbum.cpp

https://invent.kde.org/graphics/digikam/commit/e323f623318cc69bd1e1e250e5d8c5eb074da6b6