WhyNotHugo / python-barcode

㊙️ Create standard barcodes with Python. No external dependencies. 100% Organic Python.
http://python-barcode.rtfd.io/
MIT License
572 stars 123 forks source link

Error on the number generated #222

Closed darixsamani closed 6 months ago

darixsamani commented 7 months ago

the number generated and the bar code is different from the one I provided to the function. I use the EAN13 standard

there are differences in last number

WhyNotHugo commented 7 months ago

The last digit might be the verification digit.

WhyNotHugo commented 6 months ago

As a minimum to understand the issue I need:

darixsamani commented 6 months ago

for example, i provided this input: 2024012571997 the number generated is different on the last digit

2024012571997

WhyNotHugo commented 6 months ago

EAN13 has 13 digits, of which the last is the checksum digit. You're providing the wrong checksum, so python-barcode is replacing it with the correct digit.

The no_checksum flag should allow you to opt-out of this behaviour, but I'm noticing that it's broken right now; the original digit is lost in __init__. I'll try and patch that.

WhyNotHugo commented 6 months ago

I think https://github.com/WhyNotHugo/python-barcode/pull/98/files is the solution

WhyNotHugo commented 6 months ago

See: https://github.com/WhyNotHugo/python-barcode/issues/43

darixsamani commented 6 months ago

@WhyNotHugo Thank you I will try this solution, and I will give my feedback

WhyNotHugo commented 6 months ago

https://github.com/WhyNotHugo/python-barcode/pull/98 is not correct.

I believe https://github.com/WhyNotHugo/python-barcode/pull/224 should work

darixsamani commented 6 months ago

Please merge this pull request #224 for me to try

darixsamani commented 6 months ago

I tried it and it works very well.

darixsamani commented 6 months ago

this generates a bar code but the bar code scanner does not work