Skip to content

Commit

Permalink
minor fix of the value of processingTime property provided by QZXing.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikos.ftylitakis committed Aug 2, 2018
1 parent 16f1530 commit 501e0f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/QZXing.cpp
Expand Up @@ -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();

Expand Down Expand Up @@ -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){}

Expand All @@ -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;
Expand All @@ -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*/) {}
}
}
}
Expand Down

0 comments on commit 501e0f8

Please sign in to comment.