Summary: | Face rectangle from XMP sidecar drawn incorrectly for EXIF rotated images | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Jens <jens-bugs.kde.org> |
Component: | Faces-Detection | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 5.6.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/digikam/9b154ceeecb732ecb97d6900ab0841e643639f4e | Version Fixed In: | 7.0.0 |
Sentry Crash Report: | |||
Attachments: | example image pair with screenshot and metadata |
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 THANK YOU! That was the one missing part for my "iphoto2xmp" app that was still missing. I spent countless hours browsing the SQLite db and trying to find out why rotated images almost always had incorrect face rectangle info ... I will verify this as soon as a new appimage is ready. Thank you! Please check also other basis image transformation, as resize, flip, and crop. Gilles Caulier Not reproducible with 7.0.0-beta1 |
Created attachment 106158 [details] example image pair with screenshot and metadata I have two identical JPEG photos. Both have identical XMP sidecar files specifying two faces at identical positions using mwg-rs:Regions tag (mwg-rs:Regions / rdf:Bag / rdf:li / rdf:Description / mwg-rs:Area). The single difference between these photos is that the original image was rotated 90° left (portrait) and this was compensated by adding an EXIF orientation tag specifying 90° rotation. The other image is not rotated and has no EXIF orientation flag. With the first image, Digikam (5.6.0-pre appimage on Mac OS X 10.12.5) will show the face rectangle specified in the XMP file at an incorrect position. The second image (normalized, and EXIF orientation flag removed or reset) is OK. I have attached the EXIF metadata and XMP sidecars of one such image pair to test this, as well as (censored) screenshots of Digikam displaying both images with this metadata. The root cause must be in the EXIF metadata, because when I copy this XMP sidecar to other image pairs, face rectangles are displayed correctly. Can you think of a reason why the face rectangles are not shown at the right position? How / where is the rectangle position calculated? I have many such images (>10'000) and I do not want to redraw or redetect all faces ... Thank you!