mirror of
https://git.code.sf.net/p/zint/code
synced 2026-05-14 18:13:53 +00:00
Ensure maxium error correction capacity in QR Code
Fixes #107 reported by Daniel Gredler
This commit is contained in:
@@ -1569,15 +1569,15 @@ int qr_code(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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