mirror of https://github.com/status-im/qzxing.git
Change QMatrix to QTransform when applying orientation rotation to QImage before decode
This commit is contained in:
parent
b1659be29a
commit
4db0aa28c8
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue