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

Bug with aztec binary data? #47

Open
bonfus opened this issue Jan 25, 2024 · 4 comments
Open

Bug with aztec binary data? #47

bonfus opened this issue Jan 25, 2024 · 4 comments
Assignees

Comments

@bonfus
Copy link

bonfus commented Jan 25, 2024

Thanks for this nice library! I'm encountering a weird behavior with the --raw-bytes option:

For qrcode, everythong as expected:

> ./rxing-cli test.png encode --width 200 --height 200 --data "aaa" qrcode
Encode successful, saving...
Saved to 'test.png'
>  ./rxing-cli test.png decode --raw-bytes
Detection result:
 97 97 97

for aztec:

> ./rxing-cli test.png encode --width 200 --height 200 --data "aaa" aztec
Encode successful, saving...
Saved to 'test.png'
> ./rxing-cli test.png decode --raw-bytes
Detection result:
 224 132 47

I don't quite get the origin of the numbers above (should be 97 97 97).
The text representation is correct.

@hschimke hschimke self-assigned this Jan 26, 2024
@hschimke
Copy link
Collaborator

I'll look into this

@hschimke
Copy link
Collaborator

What's happening is that the Aztec code is being returned with the raw bytes read from the symbol. That includes some control codes and packing done by the encoder to fit the symbols into the smallest possible shape.

My conception of "raw bytes" is the bytes encoded by the symbol minus error correction (in this case: [224, 132, 47]).

I'm going to have to look into what is happening with the qrcode, because I don't remember specifically why it is returning those values, but my guess is that they were encoded as bytes into the symbol. I'll double check though.

Does this make sense?

@bonfus
Copy link
Author

bonfus commented Jan 27, 2024

That makes perfect sense. Notice that zxing-cpp behaves differently so maybe it's worth making this point clear (or maybe it's already in the doc that I didn't read so carefully! ;) )

@bonfus bonfus closed this as completed Jan 27, 2024
@hschimke
Copy link
Collaborator

I'll look into it, because I think the behavior isn't consistent through the library. The binary output also may not be consistent between the different qrcode readers (there are two). I think there is an issue, primarily that the library isn't consistent. I'm going to reopen and flag it as a bug because it needs to be tracked and at least made consistent.

@hschimke hschimke reopened this Jan 27, 2024
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

2 participants