dlenski / python-zxing

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

Parse raw bits if possible #26

Closed muued closed 10 months ago

muued commented 1 year ago

Hi, thanks for your great project. Since the option to output the raw bits contained in the barcode has been added to the command line runner of zxing in v3.5.0, this can now be captured in this wrapper. Proposed changes:

Notes:

dlenski commented 10 months ago

Hi, sorry I overlooked this PR. I'm not sure how that happened! This looks great :+1:

It will directly solve #17 and #20, and may help solve #8 and #22.

As the existing logic to determine the zxing version doesn't work correctly,

Can you clarify this? As far as I can tell, the logic for determining the Java ZXing library version works fine in all ZXing versions I've tested with, including v3.5.1.

dlenski commented 10 months ago

Merged as cd4eb88.

muued commented 10 months ago

As the existing logic to determine the zxing version doesn't work correctly,

Can you clarify this? As far as I can tell, the logic for determining the Java ZXing library version works fine in all ZXing versions I've tested with, including v3.5.1.

The code only looks at the version of the jar that sits in the package installation directory. If you pass an alternate jar with a different version via classpath or environment variable (https://github.com/dlenski/python-zxing/blob/master/zxing/__init__.py#L46-L51) the version will be incorrectly determined, i.e. the version of the jar doing the work is not the one the python wrapper thinks (and reports on the command line).