cozmo / jsQR

A pure javascript QR code reading library. This library takes in raw images and will locate, extract and parse any QR code found within.
https://cozmo.github.io/jsQR/
Apache License 2.0
3.63k stars 600 forks source link

QR scanner is lagging on Android devices #190

Open novicellrhj opened 3 years ago

novicellrhj commented 3 years ago

We recently updated to version 1.3.0 to try to battle that the scanner is lagging on several tested Android devices. That is also the case for the jsQR demo. On iOS devices the scanner is running smoothly. Upon testing I narrowed it down to that it is in fact the jsQR() function that makes the scanner lag on Android devices.

kybarg commented 3 years ago

@novicellrhj this is because processing power can't keep up with cameras frame rate. Look towards web workers to do processing on a separate thread.

danimoh commented 2 years ago

If you're interested, there's already a lib built on top of jsQR that makes use of a web worker and uses the device's native BarcodeDecetor if available: https://github.com/nimiq/qr-scanner. It's using a fork of jsQR which I somewhat try to maintain, as cozmo is unfortunately not very active anymore lately.