Commit 9b154cee authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

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.
BUGS: 376681
BUGS: 326538
BUGS: 381378
parent b4511082
......@@ -488,4 +488,7 @@ BUGFIXES FROM BUGZILLA:
468 ==> 216137 - digiKam geolocation editor crash.
469 ==> 226558 - digiKam crashes when exiting program.
470 ==> 183582 - Crash when trying to geolocate photographs after canceling empty map window.
471 ==>
471 ==> 376681 - Region Coordinates Are Sometimes inf / Large Numbers.
472 ==> 326538 - When a picture is in portrait, face thumbnails are not rotated.
473 ==> 381378 - Face rectangle from XMP sidecar drawn incorrectly for EXIF rotated images.
474 ==>
......@@ -503,7 +503,8 @@ void ImagePreviewView::slotDeleteItem()
void Digikam::ImagePreviewView::slotUpdateFaces()
{
d->faceGroup->aboutToSetInfo(ImageInfo());
//d->faceGroup->aboutToSetInfo(ImageInfo());
d->faceGroup->aboutToSetInfoAfterRotate(ImageInfo());
d->item->setAcceptHoverEvents(true);
/**
......
......@@ -367,6 +367,17 @@ void FaceGroup::aboutToSetInfo(const ImageInfo& info)
clear();
}
void FaceGroup::aboutToSetInfoAfterRotate(const ImageInfo& info)
{
if (d->info == info)
{
return;
}
//applyItemGeometryChanges();
clear();
}
static QPointF closestPointOfRect(const QPointF& p, const QRectF& r)
{
QPointF cp = p;
......
......@@ -106,6 +106,8 @@ public Q_SLOTS:
* Pass a null info if about to close. */
void aboutToSetInfo(const ImageInfo& info);
void aboutToSetInfoAfterRotate(const ImageInfo& info);
/** Enters a special state where by click + drag a new face can be created */
void addFace();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment