-
Notifications
You must be signed in to change notification settings - Fork 305
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
Null bytes in binary data #199
Comments
There does appear to be a bug here. At least I can confirm the symbol generated by BWIPP differs from bwip-js. What are the byte codes you expect from reading the barcode? For reference, the BWIPP generated barcode produces:
|
Im not sure if I understand correctly but im expecting to get the exact bytes encoded above. Actually the data that im trying to encode is much larger but the problem appears to related to handling of null bytes. After debugging i noticed that the problem comes from line 528 in file \dist\node-bwipjs.js: function $forall(o, cb) {
if (o instanceof Uint8Array) {
for (var i = 0, l = o.length; i < l; i++) {
if (!o[i]) { // 0 is falsy
break;
}
$k[$j++] = o[i];
if (cb && cb()) break;
}
// snip
} Im not sure if this is needed and if it's not then the fix is to drop that if check. |
We may have competing bug fixes. That bit of code fixed a bug in datamatrix. I will do some tests this weekend to see if it can be sorted out. |
Hi, Any progress on this? |
Not much. I cannot get the symbol generated by bwip-js to match the one generated by BWIPP, so there is something in the emulation that is not correct. But I also cannot get the symbol generated by BWIPP to produce the correct result either, so that is a concern as well. Please post an image of a valid aztec code using the example data you provided above. |
That's weird. With this input After commenting out the problematic if-statement from $forall, bwipp-js generates matching code. |
Apparently, I have forgotten how my command line tools work. Wasn't actually testing the changes... If the image generated by BWIPP matches what you expect, then I can move the change in. bwip-js now matches the image generated by BWIPP (it was the zxing decoder that was showing an odd/incorrect decode and causing confusion). |
Yes that image matches what is expected. |
The fix for this is in version 2.1.3, released yesterday. |
Hi,
I'm generating Aztec symbol with following code:
When decoding the generated symbol with https://demo.dynamsoft.com/barcode-reader, i noticed that bytes after 00 have changed to 00 bytes. The same symbol generated with zint is read correctly with above reader.
Should it be possible to encode null bytes with bwip-js?
The text was updated successfully, but these errors were encountered: