dlenski / python-zxing

python wrapper for the ZXing barcode library
GNU Lesser General Public License v3.0
121 stars 36 forks source link

Issues in decoding PDF 417 format Barcodes #30

Open adiv5 opened 6 months ago

adiv5 commented 6 months ago

I am trying to use zxing to decode PDF417 images. However Im getting an error message as follows:

ValueError: Unknown format code 'x' for object of type 'str'

Error seems to be in the __repr__ of the BarCode Class

Here is the File i'm using

Can I understand if there is any workaround for the same?

amishparekh commented 5 months ago

Any updates on this?

dlenski commented 5 months ago

What version of the Python module? zxing.__version__

What version of the Java library? zxing.BarCodeReader().zxing_version

There was a bug in the Python module related to repr() of barcodes, fixed in 50c7efe43688070d48dc10993ccff6a21516e537, and a bug in the Java library's ability to correctly output "raw bytes" for barcodes (see https://github.com/zxing/zxing/issues/1682), which the Python module currently mitigates by asking the Java library not to output them as of 07d94c542c36a8420810f8b36a4fcce63ec6ec2a.