mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
5.06k stars 976 forks source link

QR code parse error, error = R: No MultiFormat Readers were able to detect the code. #488

Open Asad9299 opened 2 years ago

Asad9299 commented 2 years ago

Hello there,

I am using this plugin for scanning QR Codes from last one month, everything was working fine but one QR gives me the above mentioned error while scanning. I have checked that QR with the demo link (https://blog.minhazav.dev/research/html5-qrcode.html#scan-using-file) as well and there also it gives me the same mentioned error. Here, I am attaching that QR image for your reference. Please look into it and provide its solution as earliest.

https://user-images.githubusercontent.com/88971111/174524621-bdcd7ca8-04ea-4a08-836f-1b5fbb733578.png

Thanks, Asad Mansuri.

ROBERT-MCDOWELL commented 2 years ago

did you try this qr code with another scanner?

Asad9299 commented 2 years ago

Yes, tried with different QR library and it got scanned easily. I have tried using https://nimiq.github.io/qr-scanner/demo/ and it got scanned successfully.

ROBERT-MCDOWELL commented 2 years ago

what are your object configuration?

Asad9299 commented 2 years ago

I have used the https://github.com/SimpleSoftwareIO/simple-qrcode for generating QR code in laravel. The size of QR was 500 * 500px.

ROBERT-MCDOWELL commented 2 years ago

I need you share your code please.

Asad9299 commented 2 years ago

I have written below code for scanning QR.

`

` Please provide some solution for the mentioned error.
ROBERT-MCDOWELL commented 2 years ago

did you try more qr code?

Asad9299 commented 2 years ago

Yes, I have tried around 100+ QRs, except the shared above all qrs were successfully scanned. Can you please check why that particular QR has an error while scanning?

ROBERT-MCDOWELL commented 2 years ago

it's your job to check why some qr code don't pass, it's not a html5-qrcode problem.

Asad9299 commented 2 years ago

Can you please let me know why that QR code gives error with your demo link as well? Also, why the same QR scammed easily using other library?

ROBERT-MCDOWELL commented 2 years ago

with no more information how can I tell you? add to your config aspectRatio:1,focusMode:"continuous",formatsToSupport:exchange_scannerFormats,advanced:[{zoom:isMobile.Android ? 1.5 : 2.0}],experimentalFeatures:{useBarCodeDetectorIfSupported:true

Asad9299 commented 2 years ago

No change, same issue persisted.

ROBERT-MCDOWELL commented 2 years ago

this is not my demo link, I'm a contributor/user, this is not my project. you should share OS, browser, version

Asad9299 commented 2 years ago

OS: Ubuntu 18.04 Browser: Google Chrome HTML5-Scanner Version: 2.0.9

ROBERT-MCDOWELL commented 2 years ago

ok first of all , update html5-qrcode to the latest version (2.2.1) or git. then try again and report the results. btw the qrcode image you uploaded is weird as it shows a square into the code which looks like the square delimiter of the QR code which maybe can disturb the scan. Did you said the other Qr-code work well?

Asad9299 commented 2 years ago

Could you please let me know from where I can get that? Since, I am using the version given in demo link.

ROBERT-MCDOWELL commented 2 years ago

https://github.com/mebjas/html5-qrcode/releases/tag/v2.2.1

Asad9299 commented 2 years ago

used this latest js but still no luck! Issue persisted again. The other QR codes were worked well and the mentioned QR also worked absolutely fine with other plugins except this.

ROBERT-MCDOWELL commented 2 years ago

try several qr-code that used to work for you and tell me if it's ok. what version of chrome you have? did you add in your config experimentalFeatures: {useBarCodeDetectorIfSupported: true} ?

ROBERT-MCDOWELL commented 2 years ago

I tried this Qrcode on my side and indeed it does not work. I suspect it's a corrupted one. you said it was working one month before but before what? chrome update? other? did you try this qrcode with other scanners? if yes and works, could you see any result?

ROBERT-MCDOWELL commented 2 years ago

I uploaded this qrcode at https://qrscanneronline.com/ and the result is 1ecddb0d-72ae-662c-8091-8cec4bc712b8 is it the result you are expecting for?

ROBERT-MCDOWELL commented 2 years ago

Ok I think I understand what's happening. your Qrcode image does not have white margins and confuse the algorithm. try to add white margins all arround the qrcode and see if it works. if yes, I suggest to open a "feature" issue asking to add white margins on uploaded images or you can do it yourself and create a PR.

Asad9299 commented 2 years ago

Yes, the result is correct which you have shared. I have tried with black margins but then sometimes it got scanned with black margin and some time it gives the same error.

One more strange thing is, the QR in question scanned easily using the option Using Web Cam given in this plugin itself but that same QR gives error when using the option Using File.. I am not able to figure it out why same plugin give 2 different result for same QR using different scanning methods?

ROBERT-MCDOWELL commented 2 years ago

the algorithm is different or it's a bug somewhere.... you should open a new issue on this subject and stay accurate concerning what we said here by relating a link of this actual issue. please close this issue thanks.

Asad9299 commented 2 years ago

What's the conclusion? Should I continue using Scan with Camera option instead of Scan with Image till the time some solution is provided? Your thoughts?

ROBERT-MCDOWELL commented 2 years ago

I suggest you search the issue in the code and create a PR to fix it for the project.