nos expected result with gs1_128 #75

Open
opened 2020-05-27 14:18:20 +02:00 by ctc87 · 12 comments
ctc87 commented 2020-05-27 14:18:20 +02:00 (Migrated from github.com)

When create barcode from string :

`
def generate_barcode(self):

    code = u"(01)01234567890128(15)057072"
    GS1 = barcode.get_barcode_class('gs1_128')
    fp = io.BytesIO()
    gs1 = GS1(code, writer=ImageWriter()).write(fp)
    a = base64.b64encode(fp.getbuffer())

`
The expected result its:
image
The result obtanides its:
image

When create barcode from string : ` def generate_barcode(self): code = u"(01)01234567890128(15)057072" GS1 = barcode.get_barcode_class('gs1_128') fp = io.BytesIO() gs1 = GS1(code, writer=ImageWriter()).write(fp) a = base64.b64encode(fp.getbuffer()) ` The expected result its: ![image](https://user-images.githubusercontent.com/10723126/83017970-d4f03400-a024-11ea-84a7-7e11037bc226.png) The result obtanides its: ![image](https://user-images.githubusercontent.com/10723126/83018010-e76a6d80-a024-11ea-92dd-02e791d3d5c2.png)
WhyNotHugo commented 2020-05-28 21:20:53 +02:00 (Migrated from github.com)

I tried a couple of barcode readers (including this one online), and the former barcode doesn't match the input string, but the generated one reads properly.

Can you clarify a bit more what's wrong?

I tried a couple of barcode readers (including [this one online](https://www.onlinebarcodereader.com/)), and the former barcode doesn't match the input string, but the generated one reads properly. Can you clarify a bit more what's wrong?
diggy128 commented 2020-12-07 17:19:32 +01:00 (Migrated from github.com)

@WhyNotHugo
According to GS1 specs for GS-128, the parentheses enclosing the Application Identifiers (AIs) should be visible in the Human Readable Interpretation (HRI) (the string below the barcode) but should NOT be encoded in the barcode itself.

@WhyNotHugo According to GS1 specs for GS-128, the parentheses enclosing the Application Identifiers (AIs) should be visible in the Human Readable Interpretation (HRI) (the string below the barcode) but should NOT be encoded in the barcode itself.
WhyNotHugo commented 2020-12-07 18:26:49 +01:00 (Migrated from github.com)

Oh, I'd no idea. Do you have a link to this spec?

I guess the right fix then would be for this lib to add the parenthesis to the generated label, but not to the barcode itself.

Oh, I'd no idea. Do you have a link to this spec? I guess the right fix then would be for this lib to add the parenthesis to the generated label, but not to the barcode itself.
diggy128 commented 2020-12-07 23:13:01 +01:00 (Migrated from github.com)

GS1 General Specifications
For GS1-128 see Pages 272-286

Regarding the parentheses in HRI see page 229: chapter 4.15, rule 3

Keep the specs at hand. It's a great source of information and the fact that it is freely available makes it invaluable.

I'll be around if you need anything else and I can help!

[GS1 General Specifications](https://www.gs1.org/docs/barcodes/GS1_General_Specifications.pdf) For GS1-128 see Pages 272-286 Regarding the parentheses in HRI see page 229: chapter 4.15, rule 3 Keep the specs at hand. It's a great source of information and the fact that it is freely available makes it invaluable. I'll be around if you need anything else and I can help!
ctc87 commented 2020-12-09 16:16:13 +01:00 (Migrated from github.com)

Finally y use external string with the barcode to generate the final image. The problem was the parentesis . Thx for aswer.

Finally y use external string with the barcode to generate the final image. The problem was the parentesis . Thx for aswer.
diggy128 commented 2020-12-13 14:09:00 +01:00 (Migrated from github.com)

Please reopen. This does not work as it should.

Please reopen. This does not work as it should.
ctc87 commented 2020-12-14 12:42:47 +01:00 (Migrated from github.com)

Srry.

Srry.
WhyNotHugo commented 2020-12-24 14:01:34 +01:00 (Migrated from github.com)

I believe #100 (which has just been merged) should have fixed this.

Can you confirm this works fine?

I believe #100 (which has just been merged) should have fixed this. Can you confirm this works fine?
diggy128 commented 2020-12-24 14:23:59 +01:00 (Migrated from github.com)

Unfortunately it doesn't.
I skimmed through the code and the PR has to do with EAN13 not GS128 (aka code128) and adding guard bars.

Parentheses are still encoded in the barcode. Am I missing something?

Unfortunately it doesn't. I skimmed through the code and the PR has to do with EAN13 not GS128 (aka code128) and adding guard bars. Parentheses are still encoded in the barcode. Am I missing something?
WhyNotHugo commented 2020-12-24 18:43:56 +01:00 (Migrated from github.com)

My bad, mixed up barcodes 😅

My bad, mixed up barcodes 😅
diggy128 commented 2021-07-16 12:04:44 +02:00 (Migrated from github.com)

Any news on this one?

Any news on this one?
jmarxuach commented 2021-10-05 15:05:47 +02:00 (Migrated from github.com)

Hi, if you do :

gs1 = barcode.get_barcode_class('gs1_128')
barcode_img = gs1('90502087191121904229589045190400011980', writer=ImageWriter())

if you compare the image generated with the right image below, you can see they are diferent.

image

You read codebar generated, but in some cases it doesn't work.

Hi, if you do : ```python gs1 = barcode.get_barcode_class('gs1_128') barcode_img = gs1('90502087191121904229589045190400011980', writer=ImageWriter()) ``` if you compare the image generated with the right image below, you can see they are diferent. ![image](https://user-images.githubusercontent.com/34315959/136028223-9c2c3c74-2a42-4a52-a6b5-c890b7f88f28.png) You read codebar generated, but in some cases it doesn't work.
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#75
No description provided.