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
4.71k stars 938 forks source link

Aztec code from the Polish vehicle registration certificates is not recognized #418

Open Misiu opened 2 years ago

Misiu commented 2 years ago

Describe the bug The library supports Aztec codes and it works well with simple (small) codes, but it isn't able to read Aztec code from the Polish vehicle registration certificates.

To Reproduce Steps to reproduce the behavior:

  1. Display the code on your PC or print it
  2. Open https://scanapp.org/#reader or your library sample page
  3. Try to read the code

Expected behavior The library should support larger Aztec codes (including the one I've provided)

Screenshots Sample code image

what should the library read: XXC1|BAM5210661|1465178|PREZYDENT M. ST. WARSZAWY|DZIELNICA WŁOCHY|AL. KRAKOWSKA 257|02-133 WARSZAWA|WW 444XP|MERCEDES-BENZ||||S 350 D 4MATIC|WDD2221331A229124|2016-12-19|---|POLMAN S.A.||||012110950|02-197|WARSZAWA|WARSZAWA|NA SKRAJU|68||POLMAN S.A.||||012110950|02-197|WARSZAWA|WARSZAWA|NA SKRAJU|68||2750|2750|4935|2045|---|---|2|2100|750|---|2987,00|190,00|D |2015-10-07|5|---|SAMOCHÓD OSOBOWY|---|2015|---|14,31|AAC3745751|03470119000000|03|01|000|1111NNNNNNNN|009007001|

Smartphone (please complete the following information):

Additional context I've tested the code with two apps: https://play.google.com/store/apps/details?id=pl.zaufanatrzeciastrona.zxing.client.android&hl=pl https://play.google.com/store/apps/details?id=com.apreel.aztecscanner&hl=pl

both read the code perfect

bluepuma77 commented 2 years ago

Be aware that the image to be decoded seems always to be taken from the reader div. So even if you have a high-resolution camera, if the div is too small the encoder may not be able to correctly read the code.

So I recommend you create your own page with a larger reader div and try again. Let us know if that helps.

Misiu commented 2 years ago

@bluepuma77 sure thing. Will try that and report back

Misiu commented 2 years ago

@bluepuma77 sadly this isn't working. I have a codesandbox that's trying to read my codes - https://codesandbox.io/s/scanner-forked-r09v9?file=/src/App.js I've removed the qrbox property but that didn't help. As mentioned before the apps I linked work really well.

StenGruener commented 2 years ago

@Misiu your approach actually worked with my (other) big QR codes - increasing qrbox to 330 or leaving it out

Looks like your problem is different though -> I cannot read you example even with that https://zxing-js.github.io/library/examples/aztec-camera/ example, maybe the problem is deeper in the zxing-js?

Misiu commented 2 years ago

@StenGruener I can confirm that the demo you linked doesn't work with the code I posted or with actual document scanning. the library is using Barcode Detection API (https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API), maybe it will work. not sure how to test that. I've created a react-native app that is using https://www.npmjs.com/package/expo-barcode-scanner and it reads the code just fine. But I'd like to create an open-source website where everyone from Poland will be able to read the data from their vehicle registration certificates.

Misiu commented 2 years ago

@mebjas I've edited my previous message and linked the correct package that I've used in my prototype app, it's https://www.npmjs.com/package/expo-barcode-scanner

Misiu commented 2 years ago

@mebjas any updates? Any way I could help?

Misiu commented 1 year ago

@mebjas ping

pcholewa commented 1 year ago

@mebjas any updates?

Misiu commented 10 months ago

Ping