qr-scanner
qr-scanner copied to clipboard
Some tests that return no result.
I use QrScanner for the images below but it returns no result (Error in Promise).
const file = event.target.files[0];
QrScanner.scanImage(file).then(...);
Both of the images are readable by QCode Decoder by CiroCosta. Hence I'm using both libraries, which cover every cases I've tested so far.
Furthermore, there are lot of cases when scanning from image doesn't works but scanning from file does.
const image = document.querySelector('img');
const file = event.target.files[0];
const reader = new FileReader();
reader.readAsDataURL(file);
await new Promise(resolve => reader.onloadend = resolve);
image.src = reader.result;
QrScanner.scanImage(image).then(...);