mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Correct bug in QR Code
Correction of version number bug. Version information was encoded backwards in QR Code symbols > version 7. Thanks to Chew Boon Heng and Giovanni Pedruzzi for reporting, and thanks to Sean Owen from the ZXing group for working out the problem.
This commit is contained in:
parent
d0f15ef423
commit
08a24d9f94
12
backend/qr.c
12
backend/qr.c
@ -984,12 +984,12 @@ void add_version_info(unsigned char *grid, int size, int version)
|
||||
|
||||
long int version_data = qr_annex_d[version - 7];
|
||||
for(i = 0; i < 6; i++) {
|
||||
grid[((size - 11) * size) + i] += (version_data >> (17 - (i * 3))) & 0x01;
|
||||
grid[((size - 10) * size) + i] += (version_data >> (16 - (i * 3))) & 0x01;
|
||||
grid[((size - 9) * size) + i] += (version_data >> (15 - (i * 3))) & 0x01;
|
||||
grid[(i * size) + (size - 11)] += (version_data >> (17 - (i * 3))) & 0x01;
|
||||
grid[(i * size) + (size - 10)] += (version_data >> (16 - (i * 3))) & 0x01;
|
||||
grid[(i * size) + (size - 9)] += (version_data >> (15 - (i * 3))) & 0x01;
|
||||
grid[((size - 11) * size) + i] += (version_data >> (i * 3)) & 0x01;
|
||||
grid[((size - 10) * size) + i] += (version_data >> ((i * 3) + 1)) & 0x01;
|
||||
grid[((size - 9) * size) + i] += (version_data >> ((i * 3) + 2)) & 0x01;
|
||||
grid[(i * size) + (size - 11)] += (version_data >> (i * 3)) & 0x01;
|
||||
grid[(i * size) + (size - 10)] += (version_data >> ((i * 3) + 1)) & 0x01;
|
||||
grid[(i * size) + (size - 9)] += (version_data >> ((i * 3) + 2)) & 0x01;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user