html5-qrcode icon indicating copy to clipboard operation
html5-qrcode copied to clipboard

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

Open Asad9299 opened this issue 3 years ago • 26 comments

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.

Asad9299 avatar Jun 20 '22 04:06 Asad9299

did you try this qr code with another scanner?

ROBERT-MCDOWELL avatar Jun 20 '22 12:06 ROBERT-MCDOWELL

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.

Asad9299 avatar Jun 20 '22 12:06 Asad9299

what are your object configuration?

ROBERT-MCDOWELL avatar Jun 20 '22 13:06 ROBERT-MCDOWELL

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

Asad9299 avatar Jun 20 '22 13:06 Asad9299

I need you share your code please.

ROBERT-MCDOWELL avatar Jun 20 '22 13:06 ROBERT-MCDOWELL

I have written below code for scanning QR.

`

`

Please provide some solution for the mentioned error.

Asad9299 avatar Jun 21 '22 04:06 Asad9299

did you try more qr code?

ROBERT-MCDOWELL avatar Jun 21 '22 13:06 ROBERT-MCDOWELL

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?

Asad9299 avatar Jun 21 '22 13:06 Asad9299

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

ROBERT-MCDOWELL avatar Jun 21 '22 13:06 ROBERT-MCDOWELL

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?

Asad9299 avatar Jun 21 '22 15:06 Asad9299

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

ROBERT-MCDOWELL avatar Jun 21 '22 15:06 ROBERT-MCDOWELL

No change, same issue persisted.

Asad9299 avatar Jun 22 '22 07:06 Asad9299

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

ROBERT-MCDOWELL avatar Jun 22 '22 13:06 ROBERT-MCDOWELL

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

Asad9299 avatar Jun 23 '22 05:06 Asad9299

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?

ROBERT-MCDOWELL avatar Jun 23 '22 11:06 ROBERT-MCDOWELL

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

Asad9299 avatar Jun 23 '22 11:06 Asad9299

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

ROBERT-MCDOWELL avatar Jun 23 '22 11:06 ROBERT-MCDOWELL

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.

Asad9299 avatar Jun 23 '22 12:06 Asad9299

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 avatar Jun 23 '22 12:06 ROBERT-MCDOWELL

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 avatar Jun 23 '22 13:06 ROBERT-MCDOWELL

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 avatar Jun 23 '22 13:06 ROBERT-MCDOWELL

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.

ROBERT-MCDOWELL avatar Jun 23 '22 13:06 ROBERT-MCDOWELL

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?

Asad9299 avatar Jun 23 '22 13:06 Asad9299

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.

ROBERT-MCDOWELL avatar Jun 23 '22 13:06 ROBERT-MCDOWELL

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?

Asad9299 avatar Jun 24 '22 04:06 Asad9299

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

ROBERT-MCDOWELL avatar Jun 24 '22 11:06 ROBERT-MCDOWELL