mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-22 15:48:26 +00:00
QZXingFilter: More fixes to captureRect stuff
This commit is contained in:
parent
fe26b2112e
commit
815dec7252
@ -128,7 +128,7 @@ QVideoFrame QZXingFilterRunnable::run(QVideoFrame * input, const QVideoSurfaceFo
|
|||||||
|
|
||||||
static bool isRectValid(const QRect& rect)
|
static bool isRectValid(const QRect& rect)
|
||||||
{
|
{
|
||||||
return rect.x() > 0 && rect.y() > 0 && rect.isValid();
|
return rect.x() >= 0 && rect.y() >= 0 && rect.isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
static QImage rgbDataToGrayscale(const uchar* data, const int width, const int height,
|
static QImage rgbDataToGrayscale(const uchar* data, const int width, const int height,
|
||||||
@ -264,7 +264,7 @@ void QZXingFilterRunnable::processVideoFrameProbed(SimpleVideoFrame & videoFrame
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!captureRect.isEmpty() && image.size() != captureRect.size())
|
if (isRectValid(captureRect) && image.size() != captureRect.size())
|
||||||
image = image.copy(captureRect);
|
image = image.copy(captureRect);
|
||||||
|
|
||||||
// qDebug() << "image.size()" << image.size();
|
// qDebug() << "image.size()" << image.size();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user