nimiq / qr-scanner

Lightweight Javascript QR Code Scanner
https://nimiq.github.io/qr-scanner/demo
MIT License
2.44k stars 529 forks source link

how to use QrScanner.scanImage() method in web worker. #185

Closed samhuang1111 closed 1 year ago

samhuang1111 commented 2 years ago

I want to scale the image and then scan qr code. because my qr code distance my camera is some far.

I need to scan the whole size image.

QrScanner.scanImage() handler too much time. cause main thread blocking

but web worekr not use "window" object.

i try use

const qrScanner = new QrScanner(
    videoElem,
    result => console.log('decoded qr code:', result),
    { /* your options or returnDetailedScanResult: true if you're not specifying any other options */ },
);

but this not suppot scale input frame image size