mirror of
https://git.code.sf.net/p/zint/code
synced 2026-01-28 14:25:59 +00:00
Ensure maxium error correction capacity in QR Code
Fixes #107 reported by Daniel Gredler
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user