symbol / qr-library

QR library for Symbol
Apache License 2.0
5 stars 10 forks source link

QR Codes containing more data(level > 13) such as MnemonicQR are unreadable #35

Closed yilmazbahadir closed 3 years ago

yilmazbahadir commented 3 years ago

Error Description When I try to read an exported MnemonicQR code in one of the Online QR Code Readers(i.e https://webqr.com ) or try to read with JS QRCode libraries (jsQR, vue-qrcode-reader), it fails to read(relatively small size QR codes succeed).

To Reproduce Steps to reproduce the behaviour:

  1. Go to 'Account' page
  2. Click on 'Backup Mnemonic'
  3. Download 'MnemonicQR Code'
  4. Open a browser and navigate to https://webqr.com
  5. Upload the downloaded MnemonicQR Code
  6. See the result => error decoding QR Code

To reproduce with js QR libraries:

Expected behavior Content of the QR Code should be shown

Screenshots & Attachments

mnemonicqr-doesntwork: mnemonicqr-doesntwork

transactionqr-with-231-chars-message-doesnt-work: transactionqr-with-231-chars-message-doesnt-work

image

qrcode-with-less-data-works: account-qr

yilmazbahadir commented 3 years ago

When I checked out the "the symbol-qr-library" repository and debugged this case; I noticed that the width of the QR code to be produced was fixed, and this was causing the QR code to be compressed and therefore become unreadable.

Although it says

If width is too small to contain the qr symbol, this option will be ignored.

on qrcode library API => https://www.npmjs.com/package/qrcode#width I couldn't see that was happening.

So when I removed the width parameter, the issue was resolved.

I can push the fix and create a PR if needed.