-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Code 128 Subtype is Changed #244
Comments
Hi,
I see three options how this could be handled:
I guess the first option is the easiest to implement. For the other two, I don't know how much effort that would be and how libraries on Android are bundled. Maybe feedback from the zxing developers would help. What do you think? And @TheLastProject: Thank you so much for your active efforts on this and other projects! You are a blessing! 🙇 |
Thanks for the deep research! This is very helpful info. I am thinking what would possibly be the simplest, also for the ZXING developers, is to just add these subtypes to BarcodeFormat. That way, we could just save the barcode as What do you think? Would that be worth suggesting to the zxing developers? If you don't mind, I feel it would be best for you to file such an issue with them as you seem to understand the details better than I do. |
I think they will not like that because the subtype can be changed at any point in the barcode, so the solution with |
I realized that we can actually figure out the code set (subtype) of the scanned bar code from the raw bytes, using a few lines of code in Catima. But there is currently no way to use the code set when generating a new bar code (see my description in the zxing group). |
In the zxing group it was suggested to modify the code (for example to accept a hint to force the encoding).
Currently zxing is at 3.4.1. |
The zxing team made a small change (not even a functionality change) that broke everything, see #147 and zxing/zxing#1170. Right now, I just haven't updated because there isn't much new really worth it. But I can try to figure out how to maintain a fork of zxing if there are meaningful updates in zxing. Maybe I can work together with @markusfisch there, given he seems to have a similar opinion to me: markusfisch/BinaryEye#190 there. So don't worry, I'll make sure we can upgrade zxing if a meaningful patch is introduced there. |
Hmm, it seems the mailing list kinda... went quiet. Maybe you should just make that PR to zxing and see what they say? |
I ported the change to the master branch and opened a PR: zxing/zxing#1411 |
I noticed a new FAQ entry in the zxing FAQ which allows me to upgrade the zxing version used without dropping support for old devices, so I did that in cbcf1bc. So Catima is already halfway ready for when your patch gets merged (just need to add support for saving the code set and rendering a specific code set). Let's hope they will accept your patch :) |
My change was merged into zxing master yesterday. 🎉 I think the points left to implement in Catima are:
Does this make sense? |
Kinda, although the variables you name are all listed as "private" so I feel that is probably not the cleanest way to do things. Anyway, after the new zxing release is out I will:
So, for now, let's wait for zxing to do a new release. Thank you for all your help so far! |
A new version of zxing has been released integrating the changes 👍 |
Hi,
When scanning a Code 128 bar code, the displayed bar code does not match. The code below contains the "0013002994" as Code 128 (Subtype B). When scanning, saving, and then displaying the bar code, it's shown in Code 128 (Subtype C) format. It seems the subtype is not saved.
Steps to reproduce:
The same behavior is also present in Loyalty Card Keychain.
I used this online generator to create these pictures, which is also how I found out the sub-types of the original and the displayed bar code.
I have no experience with Android programming, but browsing through the code, it looks like
new MultiFormatReader().decode(binaryBitmap).getBarcodeFormat().name()
is used here to get the bar code type as string ("CODE_128" in this case). It, however, does not contain the subtype. Maybe this is somewhere incom.google.zxing.ResultMetadataType
?Possibly related (though other bar code type): #44
The text was updated successfully, but these errors were encountered: