Bug 424463

Summary: Incorrect face thumbnail
Product: [Applications] digikam Reporter: kdeb
Component: Faces-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: metzpinguin
Priority: NOR    
Version First Reported In: 7.0.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 7.1.0
Sentry Crash Report:

Description kdeb 2020-07-20 13:24:40 UTC
Current weekly build for Win x64

Faces in portrait orientation raw files are correctly detected but generated thumbnails are landscape with misplaced face rectangle. Observed in CR2 and ARW files.

Problem examples here:

https://drive.google.com/drive/folders/13h5MKs4VMpKia-yKC3n1fRJdogm8rv-S
Comment 1 Maik Qualmann 2020-07-20 17:20:56 UTC
I cannot reproduce the problem here, face recognized correctly and thumbnails correctly. It is possible that under Windows the image metadata was not captured correctly during the first scan. We do not yet know the exact cause, I could not yet reproduce it with the Windows version. A file lock from other programs would be possible (opened in Explorer during import ...?). We have a bug report for this, date are also affected. It is alo possible that the orientation flag is wrong in the DB. Delete the faces, re-read the metadata from image and let the faces be detected again.

Maik
Comment 2 kdeb 2020-07-20 18:21:18 UTC
I created a clean database with just the 10 linked images and face detection and face thumbnails were ok. 

I then performed maintenance with the 3 cleaning options checked. Database cleaning wipes face thumbnails (not sure if that is bug or feature). Restarted digikam so the 10 face thumbnails needed to be regenerated and they all came out landscape. Hope you can reproduce that.
Comment 3 kdeb 2020-07-20 18:29:03 UTC
I am guessing thumbnails generated as part of face detection are good and thumbnails re-generated because they are not in the database are messed up.
Comment 4 Maik Qualmann 2020-07-20 19:11:31 UTC
I cannot reproduce it here with the Linux version, everything is completely correct. I'm doing the test tomorrow with the Windows version.

What type of database do you use (SQLite / MySQL)? The image ollection is local or network? If network, was it integrated via UNC path (\\SERVER\...)?

We only completely fixed the alignment of the face rectangles in the last Beta3 / RC versions, especially with RAW files. There is a possibility that you have incorrectly created details of thumbnails in the thumb DB and that they are still being used. Unfortunately, these are not currently deleted during a maintenance run. Change the size of a faulty face rectangle a little. Is the face thumbnail correct now?

Maik
Comment 5 kdeb 2020-07-20 21:41:55 UTC
The default SQLite on a local drive and all 4 database files were created from scratch just for the 10 linked images. There was no possibility of old data. 

I checked and the 'Also clean up the thumbnail database" maintenance option is what causes all face thumbnails to need regeneration. 

I just tried digikam-7.0.0-20200716T100238-x86-64.appimage under linux and it is the same. Running maintenance with 'Also clean up the thumbnail database' removes all face thumbnails. Selecting the images and 'Scan for Faces' from the context menu generates correct face thumbnails if they don't already exist. Regenerating face thumbnails which don't already exist by trying to view them in the people tab generates bad thumbnails for portrait oriented raw files.
Comment 6 Maik Qualmann 2020-07-21 06:02:18 UTC
Ok, I can reproduce it now. I will have a look.

Maik
Comment 7 Maik Qualmann 2020-07-21 18:16:29 UTC
Git commit 786c0f0e8a050499b60ded3579d5882e246b40eb by Maik Qualmann.
Committed on 21/07/2020 at 18:13.
Pushed by mqualmann into branch 'master'.

fix create detail thumbnail from the metadata preview
FIXED-IN: 7.1.0

M  +2    -1    NEWS
M  +11   -2    core/libs/threadimageio/thumb/thumbnailcreator_engine.cpp

https://invent.kde.org/graphics/digikam/commit/786c0f0e8a050499b60ded3579d5882e246b40eb
Comment 8 kdeb 2020-07-21 21:36:17 UTC
Thank you.