Bug 326538

Summary: When a picture is in portrait, face thumbnails are not rotated
Product: [Applications] digikam Reporter: e.longuemare
Component: Faces-WorkflowAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 4.0.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 7.0.0

Description e.longuemare 2013-10-24 02:04:40 UTC
Face thumbnails from portrait pictures are not rotated.

Reproducible: Always

Steps to Reproduce:
1.open the face management UI
2.select a face tag 
3.
Actual Results:  
face thumbnail from portrait pictures are not rotated.

Expected Results:  
face thumbnail are rotated as in picture preview

Digikam Date de compilation : Oct 23 2013 (cible : debugfull) Rév. :b30c5252509249d783307609a863d3a9c406564

Nothing has been done : compile and launch digikam, select a face tag in face management UI.
Comment 1 e.longuemare 2013-10-24 02:12:45 UTC
For those portrait pictures, sometimes the thumbnail don't meet the face : it's another piece of picture which is thumb.
Comment 2 e.longuemare 2013-10-24 02:14:20 UTC
But face square is good in preview.
Comment 3 e.longuemare 2013-10-25 15:51:38 UTC
Hello,

Have a look in thumb database :

For those two pictures, same shot, Raw + JPEG:

SELECT * FROM digikam_thumb_clone.CustomIdentifiers where identifier like "%IMG_0980%"
'detail:/media/DiskphotosTests/forêt mormal février 2012/IMG_0980.JPG?rect=774,667-845x845', '693'
'detail:/media/DiskphotosTests/forêt mormal février 2012/IMG_0980.CR2?rect=769,557-974x1109', '694'

For the JPG picture, face thumb is well orientated (portrait).
For the CR2 (RAW) pictures, the face thumbnail is a piece of the picture but not the face.
For the CR2 pictures, face marker is well placed and good in database.

Expected result : For the CR2 file, face delimited by face marker is shown in the thumbnail view 

Thank you,

Eric
Comment 4 e.longuemare 2013-10-26 09:38:08 UTC
This the same for all my shot with RAW+JPG : face marker/delimiter/rectangle is good in database but it display a bad thumbnail for RAW/CR2 files: another part of the picture is shown.

A workaround : 
1 - go to picture view (two clic on the thumbnail) and if needed check face marker/delimiter/rectangle
2 - edit the face marker/delimiter/rectangle by clicking on the tag
3 - move or enlarge a litle the face marker/delimiter/rectangle by clicking on the tag
4 - confirm

The thumbnail, in thumbview is ok.

without 3 - , nothing change in thumbnail display
Comment 5 e.longuemare 2013-10-26 09:48:50 UTC
This the same for all my shot with RAW+JPG : face marker/delimiter/rectangle is good in database but it display a bad thumbnail for RAW/CR2 files: another part of the picture is shown.

A workaround : 
1 - go to picture view (two clic on the thumbnail) and if needed check face marker/delimiter/rectangle
2 - edit the face marker/delimiter/rectangle by clicking on the tag
3 - move or enlarge a litle the face marker/delimiter/rectangle by clicking on the tag
4 - confirm
5 - return to thumbnail view by one clic one the picture

The thumbnail, in thumbview is ok.

without 3 - , nothing change in thumbnail display
Comment 6 caulier.gilles 2014-09-05 09:41:26 UTC
This dysfunction still reproducible using last digiKam 4.2.0 ?

Gilles Caulier
Comment 7 caulier.gilles 2016-07-04 16:54:28 UTC
This problem still reproducible with digiKam 5.0.0 ?

Gilles Caulier
Comment 8 caulier.gilles 2016-12-01 10:08:40 UTC
Any feedback with current AppImage bundle for Linux ?

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

Gilles Caulier
Comment 9 caulier.gilles 2017-08-15 18:11:23 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 381378

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
Comment 10 caulier.gilles 2019-12-23 15:18:43 UTC
Not reproducible with 7.0.0-beta1