Closed 1to10 closed 5 years ago
jsQR
only exposes a single function, which you call with image data and only get 0 or 1 QRs back from.
const code = jsQR(imageData, width, height, options?);
if (code) {
console.log("Found QR code", code);
}
If a QR is being scanned multiple times it's likely because wherever you're calling the jsQR
function is calling it multiple times. I can't help with that since that's code that the consumer of the library has written. I'd suggest only calling jsQR
if you haven't previously read a QR...something like this
if (hasScanned) {
const code = jsQR(imageData, width, height, options?);
if (code) {
hasScanned = true;
console.log("Found QR code", code);
}
}
Closing this issue since as I understand it it relates to the usage of jsQR, not an issue within jsQR itself. Please comment/re-open if you disagree or have additional questions.
qr code read multiple times?