Barcode lines are not equal #79

Open
opened 2020-07-18 18:26:35 +02:00 by sidraaaaa · 3 comments
sidraaaaa commented 2020-07-18 18:26:35 +02:00 (Migrated from github.com)

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:

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: ![](https://i.stack.imgur.com/vFOnm.png) Expected Output: ![](https://i.stack.imgur.com/e2zUt.png)
Nilad commented 2021-05-10 17:12:02 +02:00 (Migrated from github.com)

Get Same issue.

Code : 00000

itf = ITF(u'00000', writer=ImageWriter())

itf
<ITF('000000')>

itf.build()
['11001100110011001111100000111110000011001100110011111000001111100000110011001100111110000011111000001100111110011']

fullname = itf.save('itf_barcode')

Image:
itf_barcode

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.

Get Same issue. Code : 00000 ``` itf = ITF(u'00000', writer=ImageWriter()) itf <ITF('000000')> itf.build() ['11001100110011001111100000111110000011001100110011111000001111100000110011001100111110000011111000001100111110011'] fullname = itf.save('itf_barcode') ``` Image: ![itf_barcode](https://user-images.githubusercontent.com/12897327/117681566-834ba580-b1b2-11eb-80f8-52688fb2a5b1.png) 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.
WhyNotHugo commented 2021-05-10 17:27:30 +02:00 (Migrated from github.com)

You probably want guardbars: EAN(code, writer=ImageWriter(), guardbars=True)

You probably want `guardbars`: `EAN(code, writer=ImageWriter(), guardbars=True)`
Nilad commented 2021-05-10 17:39:21 +02:00 (Migrated from github.com)

@WhyNotHugo Probably yes, but the guardbars option is not available in itf.py

@WhyNotHugo Probably yes, but the `guardbars` option is not available in `itf.py`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
WhyNotHugo/python-barcode#79
No description provided.