Flag if DM_SQUARE is used at the same time as symbol size selection

This commit is contained in:
Robin Stuart 2017-07-26 11:16:54 +01:00
parent 6fa66d5554
commit 24f175b6f6
3 changed files with 17 additions and 5 deletions

View File

@ -1181,6 +1181,10 @@ int data_matrix_200(struct zint_symbol *symbol,const unsigned char source[], con
while (matrixH[calcsize] != matrixW[calcsize]) {
calcsize++;
}
if (optionsize != -1) {
strcpy(symbol->errtxt, "Can not force square symbols when symbol size is selected");
error_number = ZINT_WARN_INVALID_OPTION;
}
} else if (symbol->option_3 != DM_DMRE) {
/* Skip DMRE symbols */
while (isDMRE[calcsize]) {

View File

@ -1771,9 +1771,9 @@ Input | Symbol Size
30 | 16 x 48
---------------------
To force Zint only to use square symbols (versions 1-24) at the command line
use the option --square and when using the API set the value option_3 =
DM_SQUARE.
When using automatic symbol sizes you can force Zint to use square symbols
(versions 1-24) at the command line by using the option --square and when
using the API by setting the value option_3 = DM_SQUARE.
Data Matrix Rectangular Extension (DMRE) codes may be generated with the
following values as before:

View File

@ -744,7 +744,11 @@ int main(int argc, char **argv) {
strcat(my_symbol->outfile, filetype);
}
error_number = escape_char_process(my_symbol, (unsigned char*) optarg, strlen(optarg));
if (error_number == 0) {
if (error_number < 5) {
if (error_number != 0) {
fprintf(stderr, "%s\n", my_symbol->errtxt);
fflush(stderr);
}
error_number = ZBarcode_Print(my_symbol, rotate_angle);
}
generated = 1;
@ -763,7 +767,11 @@ int main(int argc, char **argv) {
case 'i': /* Take data from file */
if (batch_mode == 0) {
error_number = ZBarcode_Encode_File(my_symbol, optarg);
if (error_number == 0) {
if (error_number < 5) {
if (error_number != 0) {
fprintf(stderr, "%s\n", my_symbol->errtxt);
fflush(stderr);
}
error_number = ZBarcode_Print(my_symbol, rotate_angle);
}
generated = 1;