python-barcode
python-barcode copied to clipboard
Barcode lines are not equal
import barcode from barcode.writer import ImageWriter code=input("Enter Code") EAN = barcode.get_barcode_class('ean8') ean = EAN(code, writer=ImageWriter()) imag = ean.save('barcode')
Sometimes these unequal lines appears in my image. Why is that so? They are not that visible though, but it seems quite odd when they appear multiple times. The same thing happens when I try to print code 128 and code 39.
My output:
Expected Output:
Get Same issue.
Code : 00000
itf = ITF(u'00000', writer=ImageWriter())
itf
<ITF('000000')>
itf.build()
['11001100110011001111100000111110000011001100110011111000001111100000110011001100111110000011111000001100111110011']
fullname = itf.save('itf_barcode')
Image:
We can see in the 3 last bar, that the tiny bar have not the good width.
But if i use the SVGWriter
instead of the ImageWriter
, the bar have the correct width.
You probably want guardbars
: EAN(code, writer=ImageWriter(), guardbars=True)
@WhyNotHugo Probably yes, but the guardbars
option is not available in itf.py