Skip to content

Commit 35188c5

Browse files
committed
QRDetector: relax version plausibility check
Helps with one sample in #951.
1 parent 7371d17 commit 35188c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/qrcode/QRDetector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ DetectorResult SampleQR(const BitMatrix& image, const FinderPatternSet& fp)
399399
auto version = ReadVersion(image, dimension, mod2Pix);
400400

401401
// if the version bits are garbage -> discard the detection
402-
if (!version || std::abs(version->dimension() - dimension) > 8)
402+
if (!version || std::min(std::abs(version->dimension() - top.dim), std::abs(version->dimension() - left.dim)) > 8)
403403
return DetectorResult();
404404
if (version->dimension() != dimension) {
405405
printf("update dimension: %d -> %d\n", dimension, version->dimension());

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy