Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Division by zero error on some codes. #141

Open
jkrysakowski opened this issue Nov 29, 2022 · 0 comments
Open

Division by zero error on some codes. #141

jkrysakowski opened this issue Nov 29, 2022 · 0 comments

Comments

@jkrysakowski
Copy link

jkrysakowski commented Nov 29, 2022

I'm getting an error, when trying to decode this code:

test-fail

and it works fine for this one:

test-success

The error in the first case is:

PHP Fatal error:  Uncaught DivisionByZeroError: Division by zero in /home/jakub/Pulpit/qr_test/vendor/khanamiryan/qrcode-detector-decoder/lib/Common/PerspectiveTransform.php:118
Stack trace:
#0 /home/jakub/Pulpit/qr_test/vendor/khanamiryan/qrcode-detector-decoder/lib/Common/PerspectiveTransform.php(52): Zxing\Common\PerspectiveTransform::squareToQuadrilateral()
#1 /home/jakub/Pulpit/qr_test/vendor/khanamiryan/qrcode-detector-decoder/lib/Qrcode/Detector/Detector.php(403): Zxing\Common\PerspectiveTransform::quadrilateralToQuadrilateral()
#2 /home/jakub/Pulpit/qr_test/vendor/khanamiryan/qrcode-detector-decoder/lib/Qrcode/Detector/Detector.php(114): Zxing\Qrcode\Detector\Detector::createTransform()
#3 /home/jakub/Pulpit/qr_test/vendor/khanamiryan/qrcode-detector-decoder/lib/Qrcode/Detector/Detector.php(65): Zxing\Qrcode\Detector\Detector->processFinderPatternInfo()
#4 /home/jakub/Pulpit/qr_test/vendor/khanamiryan/qrcode-detector-decoder/lib/Qrcode/QRCodeReader.php(61): Zxing\Qrcode\Detector\Detector->detect()
#5 /home/jakub/Pulpit/qr_test/vendor/khanamiryan/qrcode-detector-decoder/lib/QrReader.php(91): Zxing\Qrcode\QRCodeReader->decode()
#6 /home/jakub/Pulpit/qr_test/test.php(8): Zxing\QrReader->decode()
#7 {main}
  thrown in /home/jakub/Pulpit/qr_test/vendor/khanamiryan/qrcode-detector-decoder/lib/Common/PerspectiveTransform.php on line 118

Library version: 2.0.2

Problem happens for QR codes generated with error correction level <= high. Works fine if the level is Quartile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant