mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Ensure maxium error correction capacity in QR Code
Fixes #107 reported by Daniel Gredler
This commit is contained in:
parent
628078021b
commit
2642a418b9
@ -1571,13 +1571,13 @@ int qr_code(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure maxium error correction capacity */
|
/* Ensure maxium error correction capacity */
|
||||||
if (est_binlen <= qr_data_codewords_M[version - 1]) {
|
if (est_binlen <= qr_data_codewords_M[version - 1] * 8) {
|
||||||
ecc_level = LEVEL_M;
|
ecc_level = LEVEL_M;
|
||||||
}
|
}
|
||||||
if (est_binlen <= qr_data_codewords_Q[version - 1]) {
|
if (est_binlen <= qr_data_codewords_Q[version - 1] * 8) {
|
||||||
ecc_level = LEVEL_Q;
|
ecc_level = LEVEL_Q;
|
||||||
}
|
}
|
||||||
if (est_binlen <= qr_data_codewords_H[version - 1]) {
|
if (est_binlen <= qr_data_codewords_H[version - 1] * 8) {
|
||||||
ecc_level = LEVEL_H;
|
ecc_level = LEVEL_H;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user