nuintun / qrcode

A pure JavaScript QRCode encode and decode library.
https://nuintun.github.io/qrcode
MIT License
201 stars 28 forks source link

Failed to decode QR code. #334

Open yapzhenyie opened 7 months ago

yapzhenyie commented 7 months ago

I'm facing one issue where the qrcode library not able to decode the below qrcode image.

I tried decode in some other websites or even using my phone qr code scanner. It was able to decode, but @nuintun/qrcode library not. WhatsApp Image 2024-04-27 at 23 45 29

nuintun commented 6 months ago

The QR code decoding does not perform extensive image preprocessing for performance considerations.

The example image you provided has too high a resolution, resulting in imperfections in the image after binarization.

image

You can try resizing the image to an appropriate size before decoding.

326458163-1fbca97f-2fee-4110-b88d-9387d5d55408

image