Bug 275670

Summary: Face preview image incorrect on 'rotated' images
Product: [Applications] digikam Reporter: Gareth <gareth.glaccum>
Component: Faces-WorkflowAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 2.7.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 6.0.0
Sentry Crash Report:
Attachments: Example of the Digikam 2.7.0 Interface showing the Bug

Description Gareth 2011-06-14 23:56:56 UTC
I think that if a source image is rotated by the camera, the position of the preview image might be mirrored vertically.
A portrait picture of someone, when viewed under View Image, shows a white rectangle around her face.
When viewed under thumbnails, it shows a preview of her cleavage.
Similarly on another person when standing, and the image is in portrait mode, view image shows the rectangle around the face. In thumbnail mode, zoomed in on her thighs. (and it would happen to be an image where she is wearing shorts)
Images which are in landscape mode seem to be OK.
Not sure how to create a 'test' case for this.
Comment 1 Gareth 2011-06-15 00:15:49 UTC
It might occur only with one 'face' preview per image.
Viewing an image which had a couple in it, in portrait mode, one of them was tagged correctly, and you could see the face in the preview. The other, the face preview was of their knees. (However when viewed under View Image, both rectangles were on the faces).
Comment 2 Marcel Wiesweg 2011-07-11 17:03:47 UTC
You are running code from current git and can reproduce this problem when 
removing faces and rescanning from a sample image?
Face detection is performed on the rotated image, because faces need to be 
upright for the detection core, and stored for the rotated image, so there is 
no good reason it should work for one face and not for another.
Comment 3 caulier.gilles 2011-12-14 13:48:39 UTC
Gareth,

Can you reproduce the dysfunction using digiKam 2.4 ?

Gilles Caulier
Comment 4 Samuel Gilbert 2012-07-11 22:43:10 UTC
Created attachment 72465 [details]
Example of the Digikam 2.7.0 Interface showing the Bug

I confirm that this bug is still present in Digikam 2.7.0.
Comment 5 Marcel Wiesweg 2012-07-29 18:10:12 UTC
Can you send me a sample image for testing? Via private mail is ok, if too large to attach.
Comment 6 caulier.gilles 2015-07-01 06:05:20 UTC
New digiKam 4.11.0 is available :

https://www.digikam.org/node/740

Can you reproduce the problem with this release ?
Comment 7 caulier.gilles 2015-08-21 07:03:52 UTC
digiKam 4.12.0 is out :

https://www.digikam.org/node/741

We need a fresh feedback using this release please...
Thanks in advance.
Comment 8 caulier.gilles 2016-07-14 06:02:40 UTC
This file still valid using last stable 5.0.0 release ?
Gilles Caulier
Comment 9 caulier.gilles 2016-11-21 16:07:58 UTC
We need feedback with last digiKam AppImage Linux Bundle:

https://drive.google.com/open?id=0BzeiVr-byqt5Y0tIRWVWelRJenM

Gilles Caulier
Comment 10 caulier.gilles 2016-11-26 10:34:35 UTC
This problem still reproducible using digiKam AppImage bundle 5.4.0 pre release
?

It available at this url :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Gilles Caulier
Comment 11 caulier.gilles 2017-04-16 20:12:31 UTC
digiKam 5.5.0 is released officially

https://download.kde.org/stable/digikam/

...and new 5.6.0 pre-release as bundle is available here :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Please check if this problem still reproducible with these versions.

Thanks in advance

Gilles Caulier
Comment 12 caulier.gilles 2017-06-22 21:39:42 UTC
digiKam 5.6.0 is now release and available as bundle for Linux, MacOS and Windows.

Can you check if problem still exists with this version ?

Thanks in advance

Gilles Caulier
Comment 13 caulier.gilles 2017-11-30 09:30:31 UTC
Please update this entry from bugzilla with current 5.8.0 pre-release bundle to see if problem remain.

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

Thanks in advance

Gilles Caulier
Comment 14 caulier.gilles 2018-08-11 12:52:52 UTC
Git commit 9b154ceeecb732ecb97d6900ab0841e643639f4e by Gilles Caulier.
Committed on 15/08/2017 at 18:06.
Pushed by cgilles into branch 'master'.

patch from Yingjie Liu for fix face tag region if image is rotated.
The tag region in database is not expected when rotate the image. The reason : function FaceGroup::aboutToSetInfo(const ImageInfo& info) in https://cgit.kde.org/digikam.git/tree/utilities/facemanagement/facegroup.cpp#n359 invoked applyItemGeometryChanges() after transformation. Before FaceGroup::aboutToSetInfo(const ImageInfo& info), the new coordination of tag region has been written into database. However, in applyItemGeometryChanges(), the tag region coordination of tag region will be change again in database which caused a wrong coordination.
A new FaceGroup::aboutToSetInfoAfterRotate(const ImageInfo& info) is now used instead of FaceGroup::aboutToSetInfo(const ImageInfo& info) which will not invoke applyItemGeometryChanges(). Then the coordination of tag region in database is true after image transformation.
Related: bug 376681, bug 326538

M  +4    -1    NEWS
M  +2    -1    app/views/imagepreviewview.cpp
M  +11   -0    utilities/facemanagement/facegroup.cpp
M  +2    -0    utilities/facemanagement/facegroup.h

https://commits.kde.org/digikam/9b154ceeecb732ecb97d6900ab0841e643639f4e