cozmo / jsQR

A pure javascript QR code reading library. This library takes in raw images and will locate, extract and parse any QR code found within.
https://cozmo.github.io/jsQR/
Apache License 2.0
3.64k stars 602 forks source link

TypeError: Cannot read property 'height' of undefined #181

Open zedL opened 4 years ago

zedL commented 4 years ago

When used with option { inversionAttempts: 'onlyInvert' } an error is thrown => TypeError: Cannot read property 'height' of undefined

kelh93 commented 3 years ago

@zedL native code, var shouldInvert = options.inversionAttempts === "attemptBoth" || options.inversionAttempts === "invertFirst"; var tryInvertedFirst = options.inversionAttempts === "onlyInvert" || options.inversionAttempts === "invertFirst"; should be edit as var shouldInvert = options.inversionAttempts === "attemptBoth" || options.inversionAttempts === "invertFirst" || options.inversionAttempts === "onlyInvert"; var tryInvertedFirst = options.inversionAttempts === "invertFirst"; try this, it works 78990088-ca8ddf80-7b35-11ea-943d-f12515fced24

eyeq commented 3 years ago

118

danimoh commented 2 years ago

This is being fixed in PR #148 which is however unfortunately not merged yet. If you are interested, have a look at https://github.com/nimiq/qr-scanner which uses a jsQR fork that already merged this PR and a couple others, as this repo is unfortunately not being maintained much lately.