Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

barcode scan -> code 128B and code 128C scan raw value has an additional character #348

Closed
brsgina opened this issue Sep 3, 2021 · 8 comments

Comments

@brsgina
Copy link

brsgina commented Sep 3, 2021

When I read a code128 or code128A format barcode using mlkit barcode scanner in my app in Android Studio , everything is fine. But when I read a code128B or code128C format barcode, it reads the raw value with an additional character, this:
image

I used this site for barcode generation: http://www.barcodegenerator.online/

@zhouyiself
Copy link
Collaborator

I tried one generated from that site and it works fine. Can you share a sample image that didn't work for you?

@brsgina
Copy link
Author

brsgina commented Sep 6, 2021

Of course!

So i generated this barcode first with the selection: CODE 128
image

And I scanned this file with my android app, I printed out the raw value:
image

After, I generated the same barcode, but with the selection of Code128B
image

I scanned that barcode too, and the raw value is the same, but with one char addition (this char is seen only in the log, when I write out in a textview, it is not there):
image

@zhouyiself
Copy link
Collaborator

Hi, the last character is part of the payload (group separator ascii 29), added by the generator.

@brsgina
Copy link
Author

brsgina commented Sep 29, 2021

I thought the same thing, but I tried it with different generator and all generator did the same, but only with that code: KGMIK000072

For example with another code:
image

And when I scan the barcode:
image
So there is no additional char in this time.

Let's see another online generator: http://generator.onbarcode.com/online-code-128-barcode-generator.aspx
image
And when I scan it:
image

But with my other code, there is no additional char with this generator either:
image
image

Even KGMIK000073 works fine.

@helsq
Copy link

helsq commented Oct 15, 2021

@zhouyiself, group separator ascii 29 is not a part of the payload in this case. ascii 29 (FNC1) in this case is a checksum. I have the same issue. If a checksum equals 29 (FNC1) ml kit returns a char 29 in a raw value.

For example.
Barcode B12326, checksum equals 86 (SYN) raw value B12326
1

Barcode B12328, checksum equals 29 (FNC1) raw value B12326[char with ascii code 29]
2

FNC1 can be returned in several cases (see GS1-128) but not when FNC1 is a checksum

@lk7630
Copy link

lk7630 commented Nov 5, 2021

When I read a code128 or code128A format barcode using mlkit barcode scanner in my app in Android Studio , everything is fine. But when I read a code128B or code128C format barcode, it reads the raw value with an additional character, this: image

I used this site for barcode generation: http://www.barcodegenerator.online/

Don't know if this is gonna help but if you use getRawValue() you can use getDisplayValue instead

@zhouyiself
Copy link
Collaborator

Updates: we have fixed this issue internally and the fix will be in our future release that is scheduled to be available at late January 2022.

@jswolf19
Copy link

jswolf19 commented Mar 5, 2022

Upgrading to 17.0.2 fixed this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants