Change QMatrix to QTransform when applying orientation rotation to QImage before decode

This commit is contained in:
Nikolaos Ftylitakis 2021-08-12 11:06:10 +03:00
parent b1659be29a
commit 4db0aa28c8
1 changed files with 5 additions and 6 deletions

View File

@ -393,12 +393,11 @@ void QZXingFilterRunnable::processVideoFrameProbed(SimpleVideoFrame & videoFrame
if (!orientation) { if (!orientation) {
decode(*image_ptr); decode(*image_ptr);
} else { } else {
QImage translatedImage = image_ptr->transformed([](QPoint center, int orientation) { QTransform transformation;
QMatrix matrix; transformation.translate(image_ptr->rect().center().x(), image_ptr->rect().center().y());
matrix.translate(center.x(), center.y()); transformation.rotate(-orientation);
matrix.rotate(-orientation);
return matrix; QImage translatedImage = image_ptr->transformed(transformation);
} (image_ptr->rect().center(), orientation));
decode(translatedImage); decode(translatedImage);
} }