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

Incorrect encoding of version M1/M3 tail data code word #25

Closed
vlad417 opened this issue Nov 5, 2012 · 3 comments
Closed

Incorrect encoding of version M1/M3 tail data code word #25

vlad417 opened this issue Nov 5, 2012 · 3 comments
Assignees

Comments

@vlad417
Copy link

vlad417 commented Nov 5, 2012

The M1 and M3 versions' encoding of the 4-bit last code word of the data appears to be incorrect. It looks like it is always shifted right by one (e.g. a code of 14 is encoded to read 7). It appears that qrencode.c:ln587 (bit = 1 << raw->oddbits;) in QRcode_encodeMaskMQR should read bit = 1 << (raw->oddbits-1);

It functions correctly with that change as far as I can tell. I apologize for not simply committing the change, but I do not have git on my work PC.

@ghost ghost assigned fukuchi Nov 6, 2012
@fukuchi
Copy link
Owner

fukuchi commented Nov 6, 2012

Thank you very much vlad417, the bug is confirmed. You must have hawk eyes! If you have a test pattern to identify this bug, would you mind to send me it? I'll add it to the test code. I just need an input string and an expected symbol.

@vlad417
Copy link
Author

vlad417 commented Nov 6, 2012

No problem. I noticed the discrepancy against our decoder. Confirmed it by writing the frame out to an image right after the "inteleaved data and ecc codes" block and decoding that by hand. Happened with the following set-ups:

ver M1, byte values: 52 54 49 57 52
ver M3-M, byte values: 87 66 65 53 89 52 55 89 80 81 81

fukuchi added a commit that referenced this issue Nov 8, 2012
@fukuchi
Copy link
Owner

fukuchi commented Nov 8, 2012

Done. Thank you for your contribution.

@fukuchi fukuchi closed this as completed Nov 8, 2012
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