Fix bugs found during GUI overhaul.

This commit is contained in:
hooper114 2009-04-26 22:04:01 +00:00
parent 96d6242412
commit f567430fea
4 changed files with 12 additions and 3 deletions

View File

@ -672,7 +672,7 @@ int aztec(struct zint_symbol *symbol, unsigned char source[])
ecc_level = symbol->option_1; ecc_level = symbol->option_1;
if(ecc_level == -1) { if((ecc_level == -1) || (ecc_level == 0)) {
ecc_level = 2; ecc_level = 2;
} }
@ -685,6 +685,7 @@ int aztec(struct zint_symbol *symbol, unsigned char source[])
/* Decide what size symbol to use - the smallest that fits the data */ /* Decide what size symbol to use - the smallest that fits the data */
compact = 0; /* 1 = Aztec Compact, 0 = Normal Aztec */ compact = 0; /* 1 = Aztec Compact, 0 = Normal Aztec */
layers = 0; layers = 0;
switch(ecc_level) { switch(ecc_level) {
/* For each level of error correction work out the smallest symbol which /* For each level of error correction work out the smallest symbol which
the data will fit in */ the data will fit in */

View File

@ -1761,6 +1761,8 @@ int composite(struct zint_symbol *symbol, unsigned char source[])
return error_number; return error_number;
} }
if(cc_mode < 1 || cc_mode > 3) { cc_mode = 1; }
if(cc_mode == 1) { if(cc_mode == 1) {
i = cc_binary_string(symbol, reduced, binary_string, cc_mode, &cc_width, &ecc_level, linear->width); i = cc_binary_string(symbol, reduced, binary_string, cc_mode, &cc_width, &ecc_level, linear->width);
if (i == ERROR_TOO_LONG) { if (i == ERROR_TOO_LONG) {

View File

@ -2,7 +2,7 @@
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2008 Robin Stuart <robin@zint.org.uk> Copyright (C) 2009 Robin Stuart <robin@zint.org.uk>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -713,6 +713,12 @@ int microqr(struct zint_symbol *symbol, unsigned char source[])
return ERROR_TOO_LONG; return ERROR_TOO_LONG;
} }
symbol_size = symbol->option_2;
if((symbol_size < 0) || (symbol_size > 4)) {
symbol_size = 0;
}
/* Decide symbol size */ /* Decide symbol size */
if(symbol_size == 0) { if(symbol_size == 0) {
if(symbol->option_1 == 1) { /* ECC Level L */ if(symbol->option_1 == 1) { /* ECC Level L */