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

This JSQR library do not work reading barcode in image. I think it has algorith issue #239

Open alexk400 opened 1 year ago

alexk400 commented 1 year ago

I have qr code in image and its read well by this site https://products.aspose.app/barcode/recognize/qr#

Jsqr reads simple qr code that with good background.

It probably locate the qr code but its not reading some qr code.

i got this incomplete JSON 5048-1260-7451-4628" }, "alg": "EDDSA", "signature": "ZgGTsuUtWHDh9Im1Jtqo48Wl1BF852kqF8HaAr/xnGbmyrS2q7+tJQUAvvl5qH47EdVt/5pkNrxRWO+t0xH1DQ=="} in data field

It should have been full json like that site output.

I am wondering anyone encounter incomplete reading of QR code.

I am googling for days trying different library . None works.

I am stuck . i need help in solving this here is image to test. let me know

alexk400 commented 1 year ago

Ok after some research , i found a solution.

The error is in the outout of JSQR.

data is not translated to proper String output. Please fix it.

So what i did is convert bindaryData into String.

There are 100s of website using JSQR and all output wrong data.

So if you guys fix , please send me thanks

enjoy!

zzynx commented 9 months ago

Hi @alexk400 , I'm very glad I found this issue of yours. When I read your sentence: "I am wondering anyone encounter incomplete reading of QR code." I thought: "Yes! That's my case".

This is the QR-code generated by a hardware device that I was trying to read: IMG-1182

As a result I get for QRCode.data (the string returned by jsQR):

240;SYSTRONIK GMBH
242;4.0072-5
243;Dec  5 2022
244;00E200600321161657000000
115;10
4;  50000200400003

That's 1xx characters long. However - thanks to your 2nd comment - I found out that binaryData was much longer. (3xx characters) By converting that binaryData array myself I get the complete data:

240;SYSTRONIK GMBH
242;4.0072-5
243;Dec  5 2022
244;00E200600321161657000000
115;10
4;  50000200400003
241;EUROLYZER STX
248;06-46-01202
67;Heizöl
2;12:09:59
1;25.04.23
26;   5.2
29;   598
39;     0
5;  23.0
7;  23.2
9;  -0.2
11;  -1.6
36;  11.4
65;  1.33
64;   0.0
132;   794
62; 100.0
205;  95.2
24;  46.1
66;   0.0
81;    79

The character jsQR struggles with, is probably the "ö" in "Heizöl" on the 9th line. All numbers in binaryData are < 128 except for that "ö" that leads to the number 246 in the "binaryData" array.

So, I 100% agree with your: "data is not translated to proper String output. Please fix it."