mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
C25STANDARD/C25INTER/C25IATA/C25LOGIC/C25IND: add check digit option (#216)
This commit is contained in:
@ -38,6 +38,7 @@ static void test_large(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
@ -46,22 +47,32 @@ static void test_large(int index, int debug) {
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_C25STANDARD, "1", 80, 0, 1, 817 },
|
||||
/* 1*/ { BARCODE_C25STANDARD, "1", 81, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 2*/ { BARCODE_C25INTER, "1", 90, 0, 1, 819 },
|
||||
/* 3*/ { BARCODE_C25INTER, "1", 91, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 4*/ { BARCODE_C25IATA, "1", 45, 0, 1, 639 },
|
||||
/* 5*/ { BARCODE_C25IATA, "1", 46, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 6*/ { BARCODE_C25LOGIC, "1", 80, 0, 1, 809 },
|
||||
/* 7*/ { BARCODE_C25LOGIC, "1", 81, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 8*/ { BARCODE_C25IND, "1", 45, 0, 1, 649 },
|
||||
/* 9*/ { BARCODE_C25IND, "1", 46, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 10*/ { BARCODE_DPLEIT, "1", 13, 0, 1, 135 },
|
||||
/* 11*/ { BARCODE_DPLEIT, "1", 14, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 12*/ { BARCODE_DPIDENT, "1", 11, 0, 1, 117 },
|
||||
/* 13*/ { BARCODE_DPIDENT, "1", 12, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 14*/ { BARCODE_ITF14, "1", 13, 0, 1, 135 },
|
||||
/* 15*/ { BARCODE_ITF14, "1", 14, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 0*/ { BARCODE_C25STANDARD, -1, "1", 80, 0, 1, 817 },
|
||||
/* 1*/ { BARCODE_C25STANDARD, -1, "1", 81, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 2*/ { BARCODE_C25STANDARD, 1, "1", 80, 0, 1, 827 },
|
||||
/* 3*/ { BARCODE_C25STANDARD, 1, "1", 81, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 4*/ { BARCODE_C25INTER, -1, "1", 90, 0, 1, 819 },
|
||||
/* 5*/ { BARCODE_C25INTER, -1, "1", 91, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 6*/ { BARCODE_C25INTER, 1, "1", 90, 0, 1, 837 },
|
||||
/* 7*/ { BARCODE_C25INTER, 1, "1", 91, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 8*/ { BARCODE_C25IATA, -1, "1", 45, 0, 1, 639 },
|
||||
/* 9*/ { BARCODE_C25IATA, -1, "1", 46, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 10*/ { BARCODE_C25IATA, 1, "1", 45, 0, 1, 653 },
|
||||
/* 11*/ { BARCODE_C25IATA, 1, "1", 46, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 12*/ { BARCODE_C25LOGIC, -1, "1", 80, 0, 1, 809 },
|
||||
/* 13*/ { BARCODE_C25LOGIC, -1, "1", 81, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 14*/ { BARCODE_C25LOGIC, 1, "1", 80, 0, 1, 819 },
|
||||
/* 15*/ { BARCODE_C25LOGIC, 1, "1", 81, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 16*/ { BARCODE_C25IND, -1, "1", 45, 0, 1, 649 },
|
||||
/* 17*/ { BARCODE_C25IND, -1, "1", 46, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 18*/ { BARCODE_C25IND, 1, "1", 45, 0, 1, 663 },
|
||||
/* 19*/ { BARCODE_C25IND, 1, "1", 46, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 20*/ { BARCODE_DPLEIT, -1, "1", 13, 0, 1, 135 },
|
||||
/* 21*/ { BARCODE_DPLEIT, -1, "1", 14, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 22*/ { BARCODE_DPIDENT, -1, "1", 11, 0, 1, 117 },
|
||||
/* 23*/ { BARCODE_DPIDENT, -1, "1", 12, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
/* 24*/ { BARCODE_ITF14, -1, "1", 13, 0, 1, 135 },
|
||||
/* 25*/ { BARCODE_ITF14, -1, "1", 14, ZINT_ERROR_TOO_LONG, -1, -1 },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
@ -77,7 +88,7 @@ static void test_large(int index, int debug) {
|
||||
testUtilStrCpyRepeat(data_buf, data[i].pattern, data[i].length);
|
||||
assert_equal(data[i].length, (int) strlen(data_buf), "i:%d length %d != strlen(data_buf) %d\n", i, data[i].length, (int) strlen(data_buf));
|
||||
|
||||
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
|
||||
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
|
||||
|
||||
ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
|
||||
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
|
||||
@ -100,22 +111,36 @@ static void test_hrt(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
char *data;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_C25STANDARD, "123456789", "123456789" },
|
||||
/* 1*/ { BARCODE_C25INTER, "123456789", "0123456789" }, // Adds leading zero if odd
|
||||
/* 2*/ { BARCODE_C25IATA, "123456789", "123456789" },
|
||||
/* 3*/ { BARCODE_C25LOGIC, "123456789", "123456789" },
|
||||
/* 4*/ { BARCODE_C25IND, "123456789", "123456789" },
|
||||
/* 5*/ { BARCODE_DPLEIT, "123456789", "00001234567890" }, // Leading zeroes added to make 13 + appended checksum
|
||||
/* 6*/ { BARCODE_DPLEIT, "1234567890123", "12345678901236" },
|
||||
/* 7*/ { BARCODE_DPIDENT, "123456789", "001234567890" }, // Leading zeroes added to make 11 + appended checksum
|
||||
/* 8*/ { BARCODE_DPIDENT, "12345678901", "123456789016" },
|
||||
/* 9*/ { BARCODE_ITF14, "123456789", "00001234567895" }, // Leading zeroes added to make 13 + appended checksum
|
||||
/* 10*/ { BARCODE_ITF14, "1234567890123", "12345678901231" },
|
||||
/* 0*/ { BARCODE_C25STANDARD, -1, "123456789", "123456789" },
|
||||
/* 1*/ { BARCODE_C25STANDARD, 1, "123456789", "1234567895" },
|
||||
/* 2*/ { BARCODE_C25STANDARD, 2, "123456789", "123456789" }, // Suppresses printing of check digit
|
||||
/* 3*/ { BARCODE_C25INTER, -1, "123456789", "0123456789" }, // Adds leading zero if odd
|
||||
/* 4*/ { BARCODE_C25INTER, 1, "123456789", "1234567895" }, // Unless check digit added when it becomes even
|
||||
/* 5*/ { BARCODE_C25INTER, 2, "123456789", "123456789" },
|
||||
/* 6*/ { BARCODE_C25INTER, -1, "1234567890", "1234567890" }, // No leading zero if even
|
||||
/* 7*/ { BARCODE_C25INTER, 1, "1234567890", "012345678905" }, // Unless check digit added when it becomes odd
|
||||
/* 8*/ { BARCODE_C25INTER, 2, "1234567890", "01234567890" },
|
||||
/* 9*/ { BARCODE_C25IATA, -1, "123456789", "123456789" },
|
||||
/* 10*/ { BARCODE_C25IATA, 1, "123456789", "1234567895" },
|
||||
/* 11*/ { BARCODE_C25IATA, 2, "123456789", "123456789" },
|
||||
/* 12*/ { BARCODE_C25LOGIC, -1, "123456789", "123456789" },
|
||||
/* 13*/ { BARCODE_C25LOGIC, 1, "123456789", "1234567895" },
|
||||
/* 14*/ { BARCODE_C25LOGIC, 2, "123456789", "123456789" },
|
||||
/* 15*/ { BARCODE_C25IND, -1, "123456789", "123456789" },
|
||||
/* 16*/ { BARCODE_C25IND, 1, "123456789", "1234567895" },
|
||||
/* 17*/ { BARCODE_C25IND, 2, "123456789", "123456789" },
|
||||
/* 18*/ { BARCODE_DPLEIT, -1, "123456789", "00001234567890" }, // Leading zeroes added to make 13 + appended checksum
|
||||
/* 19*/ { BARCODE_DPLEIT, -1, "1234567890123", "12345678901236" },
|
||||
/* 20*/ { BARCODE_DPIDENT, -1, "123456789", "001234567890" }, // Leading zeroes added to make 11 + appended checksum
|
||||
/* 21*/ { BARCODE_DPIDENT, -1, "12345678901", "123456789016" },
|
||||
/* 22*/ { BARCODE_ITF14, -1, "123456789", "00001234567895" }, // Leading zeroes added to make 13 + appended checksum
|
||||
/* 23*/ { BARCODE_ITF14, -1, "1234567890123", "12345678901231" },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
@ -126,7 +151,7 @@ static void test_hrt(int index, int debug) {
|
||||
struct zint_symbol *symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
|
||||
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
|
||||
|
||||
ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
|
||||
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
|
||||
@ -196,6 +221,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
@ -206,46 +232,67 @@ static void test_encode(int index, int generate, int debug) {
|
||||
};
|
||||
// BARCODE_ITF14 examples verified manually against GS1 General Specifications 21.0.1
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_C25STANDARD, "87654321", 0, 1, 97, "Standard Code 2 of 5; note zint uses 4X start/end wides while BWIPP uses 3X",
|
||||
/* 0*/ { BARCODE_C25STANDARD, -1, "87654321", 0, 1, 97, "Standard Code 2 of 5; note zint uses 4X start/end wides while BWIPP uses 3X",
|
||||
"1111010101110100010101000111010001110101110111010101110111011100010101000101110111010111011110101"
|
||||
},
|
||||
/* 1*/ { BARCODE_C25INTER, "87654321", 0, 1, 81, "Interleaved Code 2 of 5; verified manually against tec-it",
|
||||
/* 1*/ { BARCODE_C25STANDARD, 1, "87654321", 0, 1, 107, "With check digit",
|
||||
"11110101011101000101010001110100011101011101110101011101110111000101010001011101110101110100010111011110101"
|
||||
},
|
||||
/* 2*/ { BARCODE_C25INTER, -1, "87654321", 0, 1, 81, "Interleaved Code 2 of 5, even; verified manually against tec-it",
|
||||
"101011101010111000100010001110111000101010001000111010111010001110101011100011101"
|
||||
},
|
||||
/* 2*/ { BARCODE_C25INTER, "602003", 0, 1, 63, "DX cartridge barcode https://en.wikipedia.org/wiki/Interleaved_2_of_5 example",
|
||||
/* 3*/ { BARCODE_C25INTER, 1, "87654321", 0, 1, 99, "With check digit",
|
||||
"101010001011101110001010100010001110111011101011100010100011101110001010100011101000101011100011101"
|
||||
},
|
||||
/* 4*/ { BARCODE_C25INTER, -1, "7654321", 0, 1, 81, "Interleaved Code 2 of 5, odd",
|
||||
"101010101110111000100010001110111000101010001000111010111010001110101011100011101"
|
||||
},
|
||||
/* 5*/ { BARCODE_C25INTER, 1, "7654321", 0, 1, 81, "With check digit",
|
||||
"101010100010001110111011101011100010100011101110001010100011101010001000111011101"
|
||||
},
|
||||
/* 6*/ { BARCODE_C25INTER, -1, "602003", 0, 1, 63, "DX cartridge barcode https://en.wikipedia.org/wiki/Interleaved_2_of_5 example",
|
||||
"101010111011100010001010111010001000111010001000111011101011101"
|
||||
},
|
||||
/* 3*/ { BARCODE_C25IATA, "87654321", 0, 1, 121, "IATA Code 2 of 5; verified manually against tec-it",
|
||||
/* 7*/ { BARCODE_C25IATA, -1, "87654321", 0, 1, 121, "IATA Code 2 of 5; verified manually against tec-it",
|
||||
"1010111010101110101010101110111010111011101010111010111010101010111010111011101110101010101110101011101110101010111011101"
|
||||
},
|
||||
/* 4*/ { BARCODE_C25LOGIC, "87654321", 0, 1, 89, "Code 2 of 5 Data Logic; verified manually against tec-it",
|
||||
/* 8*/ { BARCODE_C25IATA, 1, "87654321", 0, 1, 135, "With check digit",
|
||||
"101011101010111010101010111011101011101110101011101011101010101011101011101110111010101010111010101110111010101011101011101010111011101"
|
||||
},
|
||||
/* 9*/ { BARCODE_C25LOGIC, -1, "87654321", 0, 1, 89, "Code 2 of 5 Data Logic; verified manually against tec-it",
|
||||
"10101110100010101000111010001110101110111010101110111011100010101000101110111010111011101"
|
||||
},
|
||||
/* 5*/ { BARCODE_C25IND, "87654321", 0, 1, 131, "Industrial Code 2 of 5; verified manually against tec-it",
|
||||
/* 10*/ { BARCODE_C25LOGIC, 1, "87654321", 0, 1, 99, "With check digit",
|
||||
"101011101000101010001110100011101011101110101011101110111000101010001011101110101110100010111011101"
|
||||
},
|
||||
/* 11*/ { BARCODE_C25IND, -1, "87654321", 0, 1, 131, "Industrial Code 2 of 5; verified manually against tec-it",
|
||||
"11101110101110101011101010101011101110101110111010101110101110101010101110101110111011101010101011101010111011101010101110111010111"
|
||||
},
|
||||
/* 6*/ { BARCODE_DPLEIT, "0000087654321", 0, 1, 135, "Deutsche Post Leitcode; verified manually against tec-it",
|
||||
/* 12*/ { BARCODE_C25IND, 1, "87654321", 0, 1, 145, "With check digit",
|
||||
"1110111010111010101110101010101110111010111011101010111010111010101010111010111011101110101010101110101011101110101010111010111010101110111010111"
|
||||
},
|
||||
/* 13*/ { BARCODE_DPLEIT, -1, "0000087654321", 0, 1, 135, "Deutsche Post Leitcode; verified manually against tec-it",
|
||||
"101010101110001110001010101110001110001010001011101110001010100010001110111011101011100010100011101110001010100011101000100010111011101"
|
||||
},
|
||||
/* 7*/ { BARCODE_DPLEIT, "5082300702800", 0, 1, 135, "Deutsche Post Leitcode https://de.wikipedia.org/wiki/Leitcode example",
|
||||
/* 14*/ { BARCODE_DPLEIT, -1, "5082300702800", 0, 1, 135, "Deutsche Post Leitcode https://de.wikipedia.org/wiki/Leitcode example",
|
||||
"101011101011100010001011101000101110100011101110100010001010101110111000100010100011101110100011101010001110001010001011100011101011101"
|
||||
},
|
||||
/* 8*/ { BARCODE_DPIDENT, "00087654321", 0, 1, 117, "Deutsche Post Identcode; verified manually against tec-it",
|
||||
/* 15*/ { BARCODE_DPIDENT, -1, "00087654321", 0, 1, 117, "Deutsche Post Identcode; verified manually against tec-it",
|
||||
"101010101110001110001010001011101110001010100010001110111011101011100010100011101110001010100011101000100010111011101"
|
||||
},
|
||||
/* 9*/ { BARCODE_DPIDENT, "39601313414", 0, 1, 117, "Deutsche Post Identcode https://de.wikipedia.org/wiki/Leitcode example",
|
||||
/* 16*/ { BARCODE_DPIDENT, -1, "39601313414", 0, 1, 117, "Deutsche Post Identcode https://de.wikipedia.org/wiki/Leitcode example",
|
||||
"101011101110001010001010111011100010001011100010001010111011100010001010111010001011101011100010101110001000111011101"
|
||||
},
|
||||
/* 10*/ { BARCODE_ITF14, "0000087654321", 0, 1, 135, "ITF-14; verified manually against tec-it",
|
||||
/* 17*/ { BARCODE_ITF14, -1, "0000087654321", 0, 1, 135, "ITF-14; verified manually against tec-it",
|
||||
"101010101110001110001010101110001110001010001011101110001010100010001110111011101011100010100011101110001010100011101000101011100011101"
|
||||
},
|
||||
/* 11*/ { BARCODE_ITF14, "0950110153000", 0, 1, 135, "GS1 General Specifications Figure 5.1-2",
|
||||
/* 18*/ { BARCODE_ITF14, -1, "0950110153000", 0, 1, 135, "GS1 General Specifications Figure 5.1-2",
|
||||
"101010100011101110001011101011100010001011100010101011100010001011101110100011100010001110101010101110001110001010001000111011101011101"
|
||||
},
|
||||
/* 12*/ { BARCODE_ITF14, "1540014128876", 0, 1, 135, "GS1 General Specifications Figure 5.3.2.4-1",
|
||||
/* 19*/ { BARCODE_ITF14, -1, "1540014128876", 0, 1, 135, "GS1 General Specifications Figure 5.3.2.4-1",
|
||||
"101011100010100010111010101110001000111010001011101110100010001011101011100010001110101000111011101010111000100010001110001110101011101"
|
||||
},
|
||||
/* 13*/ { BARCODE_ITF14, "0950110153001", 0, 1, 135, "GS1 General Specifications Figure 5.3.6-1",
|
||||
/* 20*/ { BARCODE_ITF14, -1, "0950110153001", 0, 1, 135, "GS1 General Specifications Figure 5.3.6-1",
|
||||
"101010100011101110001011101011100010001011100010101011100010001011101110100011100010001110101010101110001110001011101010001000111011101"
|
||||
},
|
||||
};
|
||||
@ -262,14 +309,14 @@ static void test_encode(int index, int generate, int debug) {
|
||||
struct zint_symbol *symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, -1 /*output_options*/, data[i].data, -1, debug);
|
||||
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
|
||||
|
||||
ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
|
||||
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
|
||||
|
||||
if (generate) {
|
||||
printf(" /*%3d*/ { %s, \"%s\", %s, %d, %d, \"%s\",\n",
|
||||
i, testUtilBarcodeName(data[i].symbology), testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
|
||||
printf(" /*%3d*/ { %s, %d, \"%s\", %s, %d, %d, \"%s\",\n",
|
||||
i, testUtilBarcodeName(data[i].symbology), data[i].option_2, testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
|
||||
testUtilErrorName(data[i].ret), symbol->rows, symbol->width, data[i].comment);
|
||||
testUtilModulesPrint(symbol, " ", "\n");
|
||||
printf(" },\n");
|
||||
@ -282,8 +329,8 @@ static void test_encode(int index, int generate, int debug) {
|
||||
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
|
||||
assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data);
|
||||
|
||||
if (do_bwipp && testUtilCanBwipp(i, symbol, -1, -1, -1, debug)) {
|
||||
ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf));
|
||||
if (do_bwipp && testUtilCanBwipp(i, symbol, -1, data[i].option_2, -1, debug)) {
|
||||
ret = testUtilBwipp(i, symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf));
|
||||
assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
|
||||
|
||||
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
|
||||
|
@ -1758,12 +1758,12 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
|
||||
static const struct item data[] = {
|
||||
{ "", -1, 0, 0, 0, 0, 0, 0, },
|
||||
{ "code11", BARCODE_CODE11, 1, 0, 1, 0, 0, 0, },
|
||||
{ "matrix2of5", BARCODE_C25STANDARD, 2, 0, 0, 0, 0, 0, },
|
||||
{ "interleaved2of5", BARCODE_C25INTER, 3, 0, 0, 0, 0, 0, },
|
||||
{ "iata2of5", BARCODE_C25IATA, 4, 0, 0, 0, 0, 0, },
|
||||
{ "matrix2of5", BARCODE_C25STANDARD, 2, 0, 1, 0, 0, 0, },
|
||||
{ "interleaved2of5", BARCODE_C25INTER, 3, 0, 1, 0, 0, 0, },
|
||||
{ "iata2of5", BARCODE_C25IATA, 4, 0, 1, 0, 0, 0, },
|
||||
{ "", -1, 5, 0, 0, 0, 0, 0, },
|
||||
{ "datalogic2of5", BARCODE_C25LOGIC, 6, 0, 0, 0, 0, 0, },
|
||||
{ "industrial2of5", BARCODE_C25IND, 7, 0, 0, 0, 0, 0, },
|
||||
{ "datalogic2of5", BARCODE_C25LOGIC, 6, 0, 1, 0, 0, 0, },
|
||||
{ "industrial2of5", BARCODE_C25IND, 7, 0, 1, 0, 0, 0, },
|
||||
{ "code39", BARCODE_CODE39, 8, 0, 1, 0, 0, 0, },
|
||||
{ "code39ext", BARCODE_EXCODE39, 9, 0, 1, 0, 0, 0, },
|
||||
{ "", -1, 10, 0, 0, 0, 0, 0, },
|
||||
@ -2239,7 +2239,13 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|
||||
bwipp_opts = bwipp_opts_buf;
|
||||
}
|
||||
|
||||
if (symbology == BARCODE_CODE93) {
|
||||
if (symbology == BARCODE_C25STANDARD || symbology == BARCODE_C25INTER || symbology == BARCODE_C25IATA
|
||||
|| symbology == BARCODE_C25LOGIC || symbology == BARCODE_C25IND) {
|
||||
if (option_2 == 1 || option_2 == 2) { // Add check digit without or with HRT suppression
|
||||
sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%sincludecheck", strlen(bwipp_opts_buf) ? " " : "");
|
||||
bwipp_opts = bwipp_opts_buf;
|
||||
}
|
||||
} else if (symbology == BARCODE_CODE93) {
|
||||
sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%sincludecheck", strlen(bwipp_opts_buf) ? " " : "");
|
||||
if (parse) {
|
||||
bwipp_barcode = "code93ext";
|
||||
|
Reference in New Issue
Block a user