mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-28 05:54:19 -04:00
Ensure maxium error correction capacity in QR Code
Fixes #107 reported by Daniel Gredler
This commit is contained in:
parent
628078021b
commit
2642a418b9
1 changed files with 4 additions and 4 deletions
|
@ -1569,15 +1569,15 @@ int qr_code(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 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;
|
||||
}
|
||||
if (est_binlen <= qr_data_codewords_Q[version - 1]) {
|
||||
if (est_binlen <= qr_data_codewords_Q[version - 1] * 8) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue