1
0
Fork
You've already forked python-barcode
0

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)
Copy link

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)
Copy link

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)
Copy link

@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)
Copy link

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)
Copy link

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)
Copy link

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)
Copy link

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)
Copy link

Srry.

Srry.
WhyNotHugo commented 2020年12月24日 14:01:34 +01:00 (Migrated from github.com)
Copy link

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)
Copy link

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)
Copy link

My bad, mixed up barcodes 😅

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

Any news on this one?

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

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 Branch/Tag specified
main
pre-commit-ci-update-config
extensibility
fix_sizes
feature/longer_guard_bar
ean-without-checksum
readme-formatting
cleaning
cleanup
srolin/master
michieldwitte/left-alignment-fix
v0.13.1
v0.13.0
v0.12.0
v0.11.0
v0.10.0
v0.9.0
v0.8.3
v0.8.2
v0.8.1
v0.8.0
0.8beta1
0.7
0.7beta4
0.7beta3
0.7beta2
v0.6
v0.6b3
v0.6b2
v0.6b1
v0.5.0
v0.5.0b1
v0.4.3
v0.4.2
v0.4.1
v0.4
v0.4b2
v0.4b1
v0.3
v0.3b1
v0.2.1
v0.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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
Reference in a new issue
WhyNotHugo/python-barcode
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?