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

Silent failure when passing DecodeHintType.TRY_HARDER to BrowserMultiFormatOneDReader #74

Open
toondkn opened this issue Nov 9, 2021 · 1 comment

Comments

@toondkn
Copy link

toondkn commented Nov 9, 2021

Library works great! Really easy way to get started with scanning 1D/2D codes in the browser.

I wanted to try out the DecodeHintType.TRY_HARDER hint to improve the result accuracy with the following code:

const hintMap = new Map();
hintMap.set(DecodeHintType.TRY_HARDER, true);
const codeReader = new BrowserMultiFormatOneDReader(hintMap);
const decode = codeReader.decodeFromVideoDevice(undefined, videoElement, handleResultFn);

However this fails silently. No errors in the console.
The video element never shows any video and the browser disconnects from the webcam a few seconds after giving it permission.
This happens in Chromium 98.0.4694.0 as well as Safari 15.1.

Passing other hints works just fine. It is specifically the TRY_HARDER hint that causes a silent failure.

@ale-cci
Copy link

ale-cci commented Dec 6, 2021

i have the same problem, the view crashes with Error: Could not create a Canvas element..

At first glance it seems that the cause is tempCanvasElement = null missing in the constructor of the transpiled HTMLCanvasElementLuminanceSource

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

2 participants