Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZXing does not decode some QR images #27

Open
sharifulgeo opened this issue Apr 29, 2023 · 2 comments
Open

ZXing does not decode some QR images #27

sharifulgeo opened this issue Apr 29, 2023 · 2 comments
Labels
zxing-library-issue Likely an upstream issue with Java ZXing library

Comments

@sharifulgeo
Copy link

sharifulgeo commented Apr 29, 2023

###Bug Reports
I am using zxing module of python to decode QR images like attached below. But it returns empty string.

image

I am using code like below-

from zxing import BarCodeReader
fpath = r"14767.png"
reader = BarCodeReader()
qrcode = reader.decode(fpath)
print(qrcode.raw)

Why it is returning empty string?

@dlenski
Copy link
Owner

dlenski commented Apr 29, 2023

Why it is returning empty string?

Good question.

If I use reader.decode(your_image, pure_barcode=True), then it does work correctly, outputting…

BarCode(raw='https://ldtax.gov.bd/ldtax-holdings/individual-rashid-print-offline/M2ZRY085bkljUkc4a3c1K3JrNlFwUT09', 
parsed='https://ldtax.gov.bd/ldtax-holdings/individual-rashid-print-offline/M2ZRY085bkljUkc4a3c1K3JrNlFwUT09', 
path='/tmp/235306398-552ee662-2fd3-4cb2-b7a4-0feb00ff50f1.png', 
format='QR_CODE', type='URI', points=[])

I wonder if this is a regression in ZXing? What is your reader.zxing_version? I'm using the latest, 3.5.1.

I note that the ZXing online decoder (https://zxing.org/w/decode.jspx) also fails to correctly decode this QR code.

dlenski added a commit that referenced this issue Apr 29, 2023
Possible workaround for some seemingly-sane barcodes that ZXing fails to
decode?  (ping #27)
@dlenski
Copy link
Owner

dlenski commented Apr 29, 2023

I wonder if this is a regression in ZXing? What is your reader.zxing_version? I'm using the latest, 3.5.1.

I note that the ZXing online decoder (https://zxing.org/w/decode.jspx) also fails to correctly decode this QR code.

I've also tested with ZXing 3.4.1, and get the same results. Hmmm.

I've been using --pure-barcode in all the tests, ever since d583ab0.

dlenski added a commit that referenced this issue Apr 29, 2023
Possible workaround for some seemingly-sane barcodes that ZXing fails to
decode?  (ping #27)
@dlenski dlenski added the zxing-library-issue Likely an upstream issue with Java ZXing library label Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zxing-library-issue Likely an upstream issue with Java ZXing library
Projects
None yet
Development

No branches or pull requests

2 participants