minor fix of the value of processingTime property provided by QZXing.

This commit is contained in:
nikos.ftylitakis 2018-08-02 12:00:49 +03:00
parent 16f1530c5d
commit 501e0f8738

View File

@ -321,6 +321,7 @@ QString QZXing::decodeImage(const QImage &image, int maxWidth, int maxHeight, bo
{
QTime t;
t.start();
processingTime = -1;
Ref<Result> res;
emit decodingStarted();
@ -349,6 +350,7 @@ QString QZXing::decodeImage(const QImage &image, int maxWidth, int maxHeight, bo
bool hasSucceded = false;
try {
res = decoder->decode(bb, hints);
processingTime = t.elapsed();
hasSucceded = true;
}catch(zxing::Exception &e){}
@ -358,8 +360,9 @@ QString QZXing::decodeImage(const QImage &image, int maxWidth, int maxHeight, bo
try {
res = decoder->decode(bb, hints);
processingTime = t.elapsed();
hasSucceded = true;
} catch(zxing::Exception &e) {}
} catch(zxing::Exception &/*e*/) {}
if (tryHarder_ && bb->isRotateSupported()) {
Ref<BinaryBitmap> bbTmp = bb;
@ -372,7 +375,7 @@ QString QZXing::decodeImage(const QImage &image, int maxWidth, int maxHeight, bo
res = decoder->decode(rotatedImage, hints);
processingTime = t.elapsed();
hasSucceded = true;
} catch(zxing::Exception &e) {}
} catch(zxing::Exception &/*e*/) {}
}
}
}