cozmo/jsQR

TypeError: Cannot read property 'height' of undefined

zedL opened this issue · 3 comments

zedL commented

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

@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

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.