diff --git a/ChangeLog b/ChangeLog index 3b1b8c07..39d4e728 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,8 @@ Changes - GS1: new AI 4309 with latlong checker, new currency code 925 - GUI: add automatic info feedback to "Automatic" combo item of size/row/height comboboxes +- PDF417: encodation now simpler and closer to ISO/IEC 24728:2006 Annex N + algorithm, props Jeff Skaistis Bugs ---- @@ -43,6 +45,10 @@ Bugs - vector: ensure separators don't overlap with other rectangles so that they render correctly when have RGBA alpha channel - GUI: update_preview() after Data Dialog return to ensure preview in sync +- PDF417: fix invalid numeric -> byte shift transitions, MR #151, props Jeff + Skaistis +- PDF417: fix extraneous text latch after a byte shift, MR #151, props Jeff + Skaistis Version 2.11.0 (2022-05-24) diff --git a/backend/pdf417.c b/backend/pdf417.c index a52e7b6b..85adee3b 100644 --- a/backend/pdf417.c +++ b/backend/pdf417.c @@ -51,10 +51,17 @@ #include "pdf417.h" #include "pdf417_tabs.h" +/* Modes */ #define TEX 900 #define BYT 901 #define NUM 902 +/* TEX mode sub-modes */ +#define T_ALPHA 1 +#define T_LOWER 2 +#define T_MIXED 4 +#define T_PUNCT 8 + /* Three figure numbers in comments give the location of command equivalents in the original Visual Basic source code file pdf417.frm @@ -62,6 +69,7 @@ /* text mode processing tables */ +/* TEX sub-mode assignments */ static const char pdf_asciix[127] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 8, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 8, 4, 12, 4, 4, 8, 8, 8, 12, 4, 12, 12, 12, 12, 4, 4, 4, 4, 4, 4, 4, 4, @@ -70,6 +78,7 @@ static const char pdf_asciix[127] = { 2, 2, 2, 2, 8, 8, 8, 8 }; +/* TEX sub-mode values */ static const char pdf_asciiy[127] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 15, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 10, 20, 15, 18, 21, 10, 28, 23, 24, 22, 20, 13, 16, 17, 19, 0, 1, 2, 3, @@ -106,24 +115,146 @@ static int pdf_quelmode(const unsigned char codeascii) { return BYT; } -static int pdf_text_num_length(int liste[2][PDF_MAX_LEN], int* indexliste, const int start) -{ - /* check consecutive segments for text/num and return the length */ +/* Check consecutive segments for text/num and return the length */ +static int pdf_text_num_length(const int liste[3][PDF_MAX_LEN], const int indexliste, const int start) { int i, len = 0; - for (i = start; i < *(indexliste); i++) { + for (i = start; i < indexliste; i++) { if (liste[1][i] == BYT) break; len += liste[0][i]; - if (len >= 5) /* we don't care if it's longer than 5 */ + if (len >= 5) /* we don't care if it's longer than 5 */ break; } return len; } -/* Pack segments using the method described in Appendix D of the AIM specification */ -static void pdf_appendix_d_encode(int liste[2][PDF_MAX_LEN], int* indexliste, const int debug_print) { +/* Calculate length of TEX allowing for sub-mode switches (no-output version of `pdf_textprocess()`) */ +static int pdf_text_submode_length(const unsigned char chaine[], const int start, const int length, int *p_curtable) { + int j, indexlistet, curtable, listet[PDF_MAX_LEN], wnet; + + wnet = 0; + curtable = *p_curtable; + + for (indexlistet = 0; indexlistet < length; indexlistet++) { + listet[indexlistet] = pdf_asciix[chaine[start + indexlistet]]; + } + + for (j = 0; j < length; j++) { + if (listet[j] & curtable) { + /* The character is in the current table */ + wnet++; + } else { + /* Obliged to change table */ + int newtable; + if (j == (length - 1) || !(listet[j] & listet[j + 1])) { + /* we change only one character - look for temporary switch */ + if ((listet[j] & T_ALPHA) && (curtable == T_LOWER)) { + wnet += 2; /* AS+char */ + continue; + } + if (listet[j] & T_PUNCT) { /* (T_PUNCT and T_ALPHA not both possible) */ + wnet += 2; /* PS+char */ + continue; + } + /* No temporary switch available */ + newtable = listet[j]; + } else { + newtable = listet[j] & listet[j + 1]; + } + + /* 599 */ + + /* Maintain the first if several tables are possible */ + if (newtable == 7) { /* (T_ALPHA | T_LOWER | T_MIXED) */ + newtable = T_ALPHA; + } else if (newtable == 12) { /* (T_MIXED | T_PUNCT) */ + newtable = T_MIXED; + } + + /* 619 - select the switch */ + switch (curtable) { + case T_ALPHA: + switch (newtable) { + case T_LOWER: + case T_MIXED: wnet++; /* LL or ML */ + break; + case T_PUNCT: wnet += 2; /* ML+PL */ + break; + } + break; + case T_LOWER: + switch (newtable) { + case T_ALPHA: wnet += 2; /* ML+AL */ + break; + case T_MIXED: wnet++; /* ML */ + break; + case T_PUNCT: wnet += 2; /* ML+PL */ + break; + } + break; + case T_MIXED: + switch (newtable) { + case T_ALPHA: + case T_LOWER: + case T_PUNCT: wnet++; /* AL or LL or PL */ + break; + } + break; + case T_PUNCT: + switch (newtable) { + case T_ALPHA: wnet++; /* AL */ + break; + case T_LOWER: + case T_MIXED: wnet += 2; /* AL+LL or AL+ML */ + break; + } + break; + } + curtable = newtable; + wnet++; + } + } + + *p_curtable = curtable; + + return wnet; +} + +/* Whether to stay in numeric mode or not */ +static int pdf_num_stay(const unsigned char *chaine, const int indexliste, const int liste[3][PDF_MAX_LEN], + const int i) { + int curtable, last_len, last_ml, next_len, num_cws, tex_cws; + + if (liste[0][i] >= 13 || (indexliste == 1 && liste[0][i] > 5)) { + return 1; + } + if (liste[0][i] < 11) { + return 0; + } + + curtable = T_ALPHA; + last_len = i == 0 ? 0 : pdf_text_submode_length(chaine, liste[2][i - 1], liste[0][i - 1], &curtable); + last_ml = curtable == T_MIXED; + + curtable = T_ALPHA; /* Next len if after NUM, sub-mode will be alpha */ + next_len = i == indexliste - 1 ? 0 : pdf_text_submode_length(chaine, liste[2][i + 1], liste[0][i + 1], &curtable); + num_cws = (last_len + 1) / 2 + 1 + 4 + (liste[0][i] > 11) + 1 + (next_len + 1) / 2; + + curtable = T_MIXED; /* Next len if stay TEX, sub-mode will be mixed */ + next_len = i == indexliste - 1 ? 0 : pdf_text_submode_length(chaine, liste[2][i + 1], liste[0][i + 1], &curtable); + tex_cws = (last_len + !last_ml + liste[0][i] + next_len + 1) / 2; + + if (num_cws > tex_cws) { + return 0; + } + return 1; +} + +/* Pack segments using the method described in Appendix D of the AIM specification (ISO/IEC 15438:2015 Annex N) */ +static void pdf_appendix_d_encode(const unsigned char *chaine, int liste[3][PDF_MAX_LEN], int *indexliste, + const int debug_print) { int i = 0, next, last = 0, stayintext = 0; while (i < *(indexliste)) { @@ -131,25 +262,27 @@ static void pdf_appendix_d_encode(int liste[2][PDF_MAX_LEN], int* indexliste, co printf("Encoding block %d = %d (%d)\n", i, liste[1][i], liste[0][i]); } - if ((liste[1][i] == NUM) && (liste[0][i] >= 13)) { + if ((liste[1][i] == NUM) && pdf_num_stay(chaine, *indexliste, liste, i)) { /* leave as numeric */ liste[0][last] = liste[0][i]; liste[1][last] = NUM; + liste[2][last] = liste[2][i]; stayintext = 0; last++; - } else if (((liste[1][i] == TEX) || (liste[1][i] == NUM)) && - (stayintext || (liste[0][i] >= 5) || (pdf_text_num_length(liste, indexliste, i) >= 5))) { + } else if (((liste[1][i] == TEX) || (liste[1][i] == NUM)) + && (stayintext || i == *indexliste - 1 || (liste[0][i] >= 5) + || (pdf_text_num_length(liste, *indexliste, i) >= 5))) { /* set to text and combine additional text/short numeric segments */ liste[0][last] = liste[0][i]; liste[1][last] = TEX; + liste[2][last] = liste[2][i]; stayintext = 0; next = i + 1; while (next < *(indexliste)) { - if ((liste[1][next] == NUM) && (liste[0][next] >= 13)) { + if ((liste[1][next] == NUM) && pdf_num_stay(chaine, *indexliste, liste, next)) { break; - } - else if (liste[1][next] == BYT) { + } else if (liste[1][next] == BYT) { break; } @@ -164,6 +297,7 @@ static void pdf_appendix_d_encode(int liste[2][PDF_MAX_LEN], int* indexliste, co /* build byte segment, including combining numeric/text segments that aren't long enough on their own */ liste[0][last] = liste[0][i]; liste[1][last] = BYT; + liste[2][last] = liste[2][i]; stayintext = 0; next = i + 1; @@ -175,7 +309,7 @@ static void pdf_appendix_d_encode(int liste[2][PDF_MAX_LEN], int* indexliste, co break; } - if ((liste[0][next] >= 5) || (pdf_text_num_length(liste, indexliste, next) >= 5)) { + if ((liste[0][next] >= 5) || (pdf_text_num_length(liste, *indexliste, next) >= 5)) { break; } } @@ -197,11 +331,12 @@ static void pdf_appendix_d_encode(int liste[2][PDF_MAX_LEN], int* indexliste, co } /* 547 */ -static void pdf_textprocess(int *chainemc, int *mclength, const unsigned char chaine[], int start, const int length, - const int lastmode, int *curtable) { - int j, indexlistet, listet[2][PDF_MAX_LEN] = {{0}}, chainet[PDF_MAX_LEN], wnet; +static void pdf_textprocess(int *chainemc, int *mclength, const unsigned char chaine[], const int start, + const int length, const int lastmode, int *p_curtable, int *p_tex_padded) { + int j, indexlistet, curtable, listet[2][PDF_MAX_LEN] = {{0}}, chainet[PDF_MAX_LEN], wnet; wnet = 0; + curtable = *p_curtable; /* listet will contain the table numbers and the value of each characters */ for (indexlistet = 0; indexlistet < length; indexlistet++) { @@ -212,11 +347,11 @@ static void pdf_textprocess(int *chainemc, int *mclength, const unsigned char ch /* 570 */ if (lastmode != TEX) { - *curtable = 1; /* set default table upper alpha */ + curtable = T_ALPHA; /* set default table upper alpha */ } for (j = 0; j < length; j++) { - if (listet[0][j] & *curtable) { + if (listet[0][j] & curtable) { /* The character is in the current table */ chainet[wnet++] = listet[1][j]; } else { @@ -224,13 +359,13 @@ static void pdf_textprocess(int *chainemc, int *mclength, const unsigned char ch int newtable; if (j == (length - 1) || !(listet[0][j] & listet[0][j + 1])) { /* we change only one character - look for temporary switch */ - if ((listet[0][j] & 1) && (*curtable == 2)) { /* T_UPP */ - chainet[wnet++] = 27; + if ((listet[0][j] & T_ALPHA) && (curtable == T_LOWER)) { + chainet[wnet++] = 27; /* AS */ chainet[wnet++] = listet[1][j]; continue; } - if (listet[0][j] & 8) { /* T_PUN (T_PUN and T_UPP not both possible) */ - chainet[wnet++] = 29; + if (listet[0][j] & T_PUNCT) { /* (T_PUNCT and T_ALPHA not both possible) */ + chainet[wnet++] = 29; /* PS */ chainet[wnet++] = listet[1][j]; continue; } @@ -243,68 +378,69 @@ static void pdf_textprocess(int *chainemc, int *mclength, const unsigned char ch /* 599 */ /* Maintain the first if several tables are possible */ - if (newtable == 7) { - newtable = 1; - } else if (newtable == 12) { - newtable = 4; + if (newtable == 7) { /* (T_ALPHA | T_LOWER | T_MIXED) */ + newtable = T_ALPHA; + } else if (newtable == 12) { /* (T_MIXED | T_PUNCT) */ + newtable = T_MIXED; } /* 619 - select the switch */ - switch (*curtable) { - case 1: + switch (curtable) { + case T_ALPHA: switch (newtable) { - case 2: chainet[wnet++] = 27; + case T_LOWER: chainet[wnet++] = 27; /* LL */ break; - case 4: chainet[wnet++] = 28; + case T_MIXED: chainet[wnet++] = 28; /* ML */ break; - case 8: chainet[wnet++] = 28; + case T_PUNCT: chainet[wnet++] = 28; /* ML+PL */ chainet[wnet++] = 25; break; } break; - case 2: + case T_LOWER: switch (newtable) { - case 1: chainet[wnet++] = 28; + case T_ALPHA: chainet[wnet++] = 28; /* ML+AL */ chainet[wnet++] = 28; break; - case 4: chainet[wnet++] = 28; + case T_MIXED: chainet[wnet++] = 28; /* ML */ break; - case 8: chainet[wnet++] = 28; + case T_PUNCT: chainet[wnet++] = 28; /* ML+PL */ chainet[wnet++] = 25; break; } break; - case 4: + case T_MIXED: switch (newtable) { - case 1: chainet[wnet++] = 28; + case T_ALPHA: chainet[wnet++] = 28; /* AL */ break; - case 2: chainet[wnet++] = 27; + case T_LOWER: chainet[wnet++] = 27; /* LL */ break; - case 8: chainet[wnet++] = 25; + case T_PUNCT: chainet[wnet++] = 25; /* PL */ break; } break; - case 8: + case T_PUNCT: switch (newtable) { - case 1: chainet[wnet++] = 29; + case T_ALPHA: chainet[wnet++] = 29; /* AL */ break; - case 2: chainet[wnet++] = 29; + case T_LOWER: chainet[wnet++] = 29; /* AL+LL */ chainet[wnet++] = 27; break; - case 4: chainet[wnet++] = 29; + case T_MIXED: chainet[wnet++] = 29; /* AL+ML */ chainet[wnet++] = 28; break; } break; } - *curtable = newtable; + curtable = newtable; /* 659 - at last we add the character */ chainet[wnet++] = listet[1][j]; } } /* 663 */ - if (wnet & 1) { + *p_tex_padded = wnet & 1; + if (*p_tex_padded) { chainet[wnet++] = 29; } /* Now translate the string chainet into codewords */ @@ -318,6 +454,8 @@ static void pdf_textprocess(int *chainemc, int *mclength, const unsigned char ch const int cw_number = (30 * chainet[j]) + chainet[j + 1]; chainemc[(*mclength)++] = cw_number; } + + *p_curtable = curtable; } /* 671 */ @@ -380,18 +518,18 @@ INTERNAL void pdf_byteprocess(int *chainemc, int *mclength, const unsigned char } /* 712 */ -static void pdf_numbprocess(int *chainemc, int *mclength, const unsigned char chaine[], int start, const int length) { - int j, loop, dummy[50] = {0}, diviseur, nombre; - char chainemod[45]; +static void pdf_numbprocess(int *chainemc, int *mclength, const unsigned char chaine[], const int start, + const int length) { + int j; chainemc[(*mclength)++] = 902; j = 0; while (j < length) { - int longueur; int dumlength = 0; - int p, len; - longueur = length - j; + int p, len, loop, nombre, dummy[50]; + char chainemod[45]; + int longueur = length - j; if (longueur > 44) { longueur = 44; } @@ -401,27 +539,24 @@ static void pdf_numbprocess(int *chainemc, int *mclength, const unsigned char ch chainemod[loop] = ctoi(chaine[start + loop + j - 1]); } do { - diviseur = 900; - /* 877 - gosub Modulo */ p = 0; nombre = 0; for (loop = 0; loop < len; loop++) { nombre *= 10; nombre += chainemod[loop]; - if (nombre < diviseur) { + if (nombre < 900) { if (p) { chainemod[p++] = 0; } } else { - chainemod[p++] = (nombre / diviseur); - nombre = nombre % diviseur; + chainemod[p] = (nombre / 900); + nombre -= chainemod[p++] * 900; /* nombre % 900 */ } } - diviseur = nombre; /* return to 723 */ - dummy[dumlength++] = diviseur; + dummy[dumlength++] = nombre; len = p; } while (p); for (loop = dumlength - 1; loop >= 0; loop--) { @@ -431,11 +566,25 @@ static void pdf_numbprocess(int *chainemc, int *mclength, const unsigned char ch } } +#ifdef ZINT_TEST /* Wrapper for direct testing */ +INTERNAL void pdf_numbprocess_test(int *chainemc, int *mclength, const unsigned char chaine[], const int start, + const int length) { + pdf_numbprocess(chainemc, mclength, chaine, start, length); +} +#endif + +/* Return mode text */ +static const char *pdf_mode_str(const int mode) { + static const char *modes[3] = { "Text", "Byte", "Number" }; + return mode >= TEX && mode <= NUM ? modes[mode - TEX] : "ERROR"; +} + /* Initial processing of data, shared by `pdf417()` and `micropdf417()` */ -static int pdf_initial(struct zint_symbol *symbol, unsigned char chaine[], const int length, const int eci, - const int is_micro, int chainemc[PDF_MAX_LEN], int *p_mclength) { - int i, indexchaine, indexliste, mode, currenttext; - int liste[2][PDF_MAX_LEN] = {{0}}; +static int pdf_initial(struct zint_symbol *symbol, const unsigned char chaine[], const int length, const int eci, + const int is_micro, int *p_lastmode, int *p_curtable, int *p_tex_padded, int chainemc[PDF_MAX_LEN], + int *p_mclength) { + int i, indexchaine, indexliste, mode; + int liste[3][PDF_MAX_LEN] = {{0}}; int mclength; const int debug_print = symbol->debug & ZINT_DEBUG_PRINT; @@ -448,6 +597,7 @@ static int pdf_initial(struct zint_symbol *symbol, unsigned char chaine[], const /* 463 */ do { liste[1][indexliste] = mode; + liste[2][indexliste] = indexchaine; while ((liste[1][indexliste] == mode) && (indexchaine < length)) { liste[0][indexliste]++; indexchaine++; @@ -457,38 +607,18 @@ static int pdf_initial(struct zint_symbol *symbol, unsigned char chaine[], const } while (indexchaine < length); if (debug_print) { - printf("\r\nInitial block pattern:\n"); + printf("\nInitial block pattern:\n"); for (i = 0; i < indexliste; i++) { - printf("Len: %d Type: ", liste[0][i]); - switch (liste[1][i]) { - case TEX: printf("Text\n"); - break; - case BYT: printf("Byte\n"); - break; - case NUM: printf("Number\n"); - break; - default: printf("ERROR\n"); /* Should never happen */ /* Not reached */ - break; - } + printf("Start: %d Len: %d Type: %s\n", liste[2][i], liste[0][i], pdf_mode_str(liste[1][i])); } } - pdf_appendix_d_encode(liste, &indexliste, debug_print); + pdf_appendix_d_encode(chaine, liste, &indexliste, debug_print); if (debug_print) { - printf("\r\nCompacted block pattern:\n"); + printf("\nCompacted block pattern:\n"); for (i = 0; i < indexliste; i++) { - printf("Len: %d Type: ", liste[0][i]); - switch (liste[1][i]) { - case TEX: printf("Text\n"); - break; - case BYT: printf("Byte\n"); - break; - case NUM: printf("Number\n"); - break; - default: printf("ERROR\n"); /* Should never happen */ /* Not reached */ - break; - } + printf("Start: %d Len: %d Type: %s\n", liste[2][i], liste[0][i], pdf_mode_str(liste[1][i])); } } @@ -522,25 +652,25 @@ static int pdf_initial(struct zint_symbol *symbol, unsigned char chaine[], const } } - /* Default mode for PDF417 is Text Compaction Alpha (ISO/IEC 1543:2015 5.4.2.1), and for MICROPDF417 is Byte - * Compaction (ISO/IEC 24728:2006 5.4.3) */ - mode = is_micro ? BYT : TEX; - currenttext = 1; /* Start in upper alpha - tracked across calls to pdf_textprocess to allow for interleaving byte shifts */ for (i = 0; i < indexliste; i++) { switch (liste[1][i]) { case TEX: /* 547 - text mode */ - pdf_textprocess(chainemc, &mclength, chaine, indexchaine, liste[0][i], mode, ¤ttext); - mode = TEX; + pdf_textprocess(chainemc, &mclength, chaine, indexchaine, liste[0][i], *p_lastmode, p_curtable, + p_tex_padded); + *p_lastmode = TEX; break; case BYT: /* 670 - octet stream mode */ - pdf_byteprocess(chainemc, &mclength, chaine, indexchaine, liste[0][i], mode, debug_print); - if (mode != TEX || liste[0][i] != 1) { /* don't switch mode on single byte shift from text mode */ - mode = BYT; + pdf_byteprocess(chainemc, &mclength, chaine, indexchaine, liste[0][i], *p_lastmode, debug_print); + if (*p_lastmode != TEX || liste[0][i] != 1) { /* don't switch mode on single byte shift from text mode */ + *p_lastmode = BYT; + } else if (*p_curtable == T_PUNCT && *p_tex_padded) { /* If T_PUNCT and padded with AL */ + /* Then need to reset to alpha - ISO/IEC 15438:2015 5.4.2.4 b) 2) */ + *p_curtable = T_ALPHA; } break; case NUM: /* 712 - numeric mode */ pdf_numbprocess(chainemc, &mclength, chaine, indexchaine, liste[0][i]); - mode = NUM; + *p_lastmode = NUM; break; } indexchaine = indexchaine + liste[0][i]; @@ -558,6 +688,9 @@ static int pdf_initial_segs(struct zint_symbol *symbol, struct zint_seg segs[], int i; int error_number = 0; int structapp_cp = 0; + int lastmode; + int curtable; + int tex_padded; *p_mclength = 0; @@ -612,9 +745,15 @@ static int pdf_initial_segs(struct zint_symbol *symbol, struct zint_seg segs[], } *p_structapp_cp = structapp_cp; + /* Default mode for PDF417 is Text Compaction Alpha (ISO/IEC 15438:2015 5.4.2.1), and for MICROPDF417 is Byte + * Compaction (ISO/IEC 24728:2006 5.4.3) */ + lastmode = is_micro ? BYT : TEX; + /* Start in upper alpha - tracked across calls to `pdf_textprocess()` to allow for interleaving byte shifts */ + curtable = T_ALPHA; + for (i = 0; i < seg_count; i++) { - error_number = pdf_initial(symbol, segs[i].source, segs[i].length, segs[i].eci, is_micro, chainemc, - p_mclength); + error_number = pdf_initial(symbol, segs[i].source, segs[i].length, segs[i].eci, is_micro, &lastmode, + &curtable, &tex_padded, chainemc, p_mclength); if (error_number) { /* Only errors return >= ZINT_ERROR */ return error_number; } @@ -1251,4 +1390,9 @@ INTERNAL int micropdf417(struct zint_symbol *symbol, struct zint_seg segs[], con #undef BYT #undef NUM +#undef T_ALPHA +#undef T_LOWER +#undef T_MIXED +#undef T_PUNCT + /* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/data/bmp/pdf417_fg_bg.bmp b/backend/tests/data/bmp/pdf417_fg_bg.bmp index 65c50a23..50bb1111 100644 Binary files a/backend/tests/data/bmp/pdf417_fg_bg.bmp and b/backend/tests/data/bmp/pdf417_fg_bg.bmp differ diff --git a/backend/tests/data/bmp/pdf417comp_hvwsp2.bmp b/backend/tests/data/bmp/pdf417comp_hvwsp2.bmp index 88cd08bb..ef0833f5 100644 Binary files a/backend/tests/data/bmp/pdf417comp_hvwsp2.bmp and b/backend/tests/data/bmp/pdf417comp_hvwsp2.bmp differ diff --git a/backend/tests/data/png/pdf417_bgalpha.png b/backend/tests/data/png/pdf417_bgalpha.png index 4034731e..a2d548cd 100644 Binary files a/backend/tests/data/png/pdf417_bgalpha.png and b/backend/tests/data/png/pdf417_bgalpha.png differ diff --git a/backend/tests/data/png/pdf417_bgfgalpha.png b/backend/tests/data/png/pdf417_bgfgalpha.png index 08d39756..e75f48f2 100644 Binary files a/backend/tests/data/png/pdf417_bgfgalpha.png and b/backend/tests/data/png/pdf417_bgfgalpha.png differ diff --git a/backend/tests/data/png/pdf417_fgalpha.png b/backend/tests/data/png/pdf417_fgalpha.png index c2710c68..9fab7b78 100644 Binary files a/backend/tests/data/png/pdf417_fgalpha.png and b/backend/tests/data/png/pdf417_fgalpha.png differ diff --git a/backend/tests/test_bmp.c b/backend/tests/test_bmp.c index 9847fb9d..ffd9cc1a 100644 --- a/backend/tests/test_bmp.c +++ b/backend/tests/test_bmp.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2020 - 2021 Robin Stuart + Copyright (C) 2020-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ +/* SPDX-License-Identifier: BSD-3-Clause */ #include "testcommon.h" #include @@ -43,7 +43,7 @@ static void test_pixel_plot(int index, int debug) { int repeat; int ret; }; - // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { /* 0*/ { 1, 1, "1", 0, 0 }, /* 1*/ { 2, 1, "11", 0, 0 }, @@ -266,3 +266,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_pdf417.c b/backend/tests/test_pdf417.c index 6249100a..8b524bee 100644 --- a/backend/tests/test_pdf417.c +++ b/backend/tests/test_pdf417.c @@ -27,6 +27,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* SPDX-License-Identifier: BSD-3-Clause */ #include "testcommon.h" @@ -44,7 +45,7 @@ static void test_large(int index, int debug) { int expected_width; char *expected_errtxt; }; - // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { /* 0*/ { BARCODE_PDF417, 0, -1, -1, "A", 1850, 0, 32, 562, "" }, /* 1*/ { BARCODE_PDF417, 0, -1, -1, "A", 1851, ZINT_ERROR_TOO_LONG, -1, -1, "Error 464: Input string too long" }, @@ -114,59 +115,59 @@ static void test_options(int index, int debug) { const char *expected_errtxt; int compare_previous; }; - // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { - /* 0*/ { BARCODE_PDF417, -1, -1, -1, 0, { 0, 0, "" }, "12345", 0, 0, 6, 103, "", -1 }, // ECC auto-set to 2, cols auto-set to 2 - /* 1*/ { BARCODE_PDF417, -1, -1, 928, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 466: Number of rows out of range (3 to 90)", -1 }, // Option 3 no longer ignored - /* 2*/ { BARCODE_PDF417, -1, -1, 1, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 466: Number of rows out of range (3 to 90)", -1 }, // Option 3 no longer ignored - /* 3*/ { BARCODE_PDF417, 3, -1, -1, 0, { 0, 0, "" }, "12345", 0, 0, 7, 120, "", -1 }, // ECC 3, cols auto-set to 3 - /* 4*/ { BARCODE_PDF417, 3, 2, -1, 0, { 0, 0, "" }, "12345", 0, 0, 10, 103, "", -1 }, // ECC 3, cols 2 - /* 5*/ { BARCODE_PDF417, 8, 2, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 86, 171, "Warning 748: Columns increased from 2 to 6", -1 }, // ECC 8, cols 2, used to fail, now auto-upped to 3 with warning + /* 0*/ { BARCODE_PDF417, -1, -1, -1, 0, { 0, 0, "" }, "12345", 0, 0, 6, 103, "", -1 }, /* ECC auto-set to 2, cols auto-set to 2 */ + /* 1*/ { BARCODE_PDF417, -1, -1, 928, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 466: Number of rows out of range (3 to 90)", -1 }, /* Option 3 no longer ignored */ + /* 2*/ { BARCODE_PDF417, -1, -1, 1, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 466: Number of rows out of range (3 to 90)", -1 }, /* Option 3 no longer ignored */ + /* 3*/ { BARCODE_PDF417, 3, -1, -1, 0, { 0, 0, "" }, "12345", 0, 0, 7, 120, "", -1 }, /* ECC 3, cols auto-set to 3 */ + /* 4*/ { BARCODE_PDF417, 3, 2, -1, 0, { 0, 0, "" }, "12345", 0, 0, 10, 103, "", -1 }, /* ECC 3, cols 2 */ + /* 5*/ { BARCODE_PDF417, 8, 2, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 86, 171, "Warning 748: Columns increased from 2 to 6", -1 }, /* ECC 8, cols 2, used to fail, now auto-upped to 3 with warning */ /* 6*/ { BARCODE_PDF417, 8, 2, -1, WARN_FAIL_ALL, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, 0, 86, 171, "Error 748: Columns increased from 2 to 6", -1 }, - /* 7*/ { BARCODE_PDF417, 7, 2, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 87, 120, "Warning 748: Columns increased from 2 to 3", -1 }, // ECC 7, cols 2 auto-upped to 3 but now with warning + /* 7*/ { BARCODE_PDF417, 7, 2, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 87, 120, "Warning 748: Columns increased from 2 to 3", -1 }, /* ECC 7, cols 2 auto-upped to 3 but now with warning */ /* 8*/ { BARCODE_PDF417, 7, 2, -1, WARN_FAIL_ALL, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, 0, 87, 120, "Error 748: Columns increased from 2 to 3", -1 }, - /* 9*/ { BARCODE_PDF417, -1, 10, -1, 0, { 0, 0, "" }, "12345", 0, 0, 3, 239, "", -1 }, // ECC auto-set to 2, cols 10 - /* 10*/ { BARCODE_PDF417, 9, -1, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 6, 103, "Warning 460: Security value out of range", -1 }, // Invalid ECC, auto-set - /* 11*/ { BARCODE_PDF417, -1, 31, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 6, 103, "Warning 461: Number of columns out of range (1 to 30)", 0 }, // Invalid cols, auto-set - /* 12*/ { BARCODE_PDF417, -1, -1, 2, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 466: Number of rows out of range (3 to 90)", -1 }, // Invalid rows, error - /* 13*/ { BARCODE_PDF417, -1, -1, 91, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 466: Number of rows out of range (3 to 90)", -1 }, // Invalid rows, error - /* 14*/ { BARCODE_PDF417, 9, -1, -1, WARN_FAIL_ALL, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 460: Security value out of range", -1 }, // Invalid ECC - /* 15*/ { BARCODE_PDF417, -1, 31, -1, WARN_FAIL_ALL, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 461: Number of columns out of range (1 to 30)", -1 }, // Invalid cols - /* 16*/ { BARCODE_PDF417, -1, 30, 31, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 475: Columns x rows out of range (1 to 928)", -1 }, // Rows * cols (930) > 928 - /* 17*/ { BARCODE_PDF417, -1, 1, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI", ZINT_WARN_INVALID_OPTION, 0, 65, 120, "Warning 748: Columns increased from 1 to 3", -1 }, // Cols 1 too small, used to fail, now auto-upped to 3 with warning - /* 18*/ { BARCODE_PDF417, -1, -1, 4, 0, { 0, 0, "" }, "12345", 0, 0, 4, 120, "", -1 }, // Specify rows 4 (cols 3) - /* 19*/ { BARCODE_PDF417, -1, 3, 4, 0, { 0, 0, "" }, "12345", 0, 0, 4, 120, "", 0 }, // Specify cols 3 & rows 4 - /* 20*/ { BARCODE_PDF417, -1, -1, 90, 0, { 0, 0, "" }, "12345", 0, 0, 90, 86, "", -1 }, // Specify rows 90 (cols 1) - /* 21*/ { BARCODE_PDF417, 0, -1, 3, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", 0, 0, 3, 579, "", -1 }, // Specify rows 3, max cols 30 - /* 22*/ { BARCODE_PDF417, 0, 30, 3, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", 0, 0, 3, 579, "", 0 }, // Specify rows 3, cols 30 - /* 23*/ { BARCODE_PDF417, 0, 29, 3, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", ZINT_WARN_INVALID_OPTION, 0, 4, 562, "Warning 746: Rows increased from 3 to 4", -1 }, // Specify rows 3, cols 29, rows auto-upped to 4 - /* 24*/ { BARCODE_MICROPDF417, -1, 5, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 11, 38, "Warning 468: Specified width out of range", -1 }, // Invalid cols, auto-set to 1 - /* 25*/ { BARCODE_MICROPDF417, -1, 5, -1, WARN_FAIL_ALL, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 468: Specified width out of range", -1 }, // Invalid cols - /* 26*/ { BARCODE_MICROPDF417, -1, 5, 3, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 476: Cannot specify rows for MicroPDF417", -1 }, // Rows option not available - /* 27*/ { BARCODE_MICROPDF417, -1, 1, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM", ZINT_WARN_INVALID_OPTION, 0, 17, 55, "Warning 469: Specified symbol size too small for data", -1 }, // Cols 1 too small, auto-upped to 2 with warning - /* 28*/ { BARCODE_MICROPDF417, -1, 1, -1, WARN_FAIL_ALL, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 469: Specified symbol size too small for data", -1 }, // Cols 1 too small - /* 29*/ { BARCODE_MICROPDF417, -1, 2, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWX", ZINT_WARN_INVALID_OPTION, 0, 15, 99, "Warning 470: Specified symbol size too small for data", -1 }, // Cols 2 too small, auto-upped to 4 with warning - /* 30*/ { BARCODE_MICROPDF417, -1, 2, -1, WARN_FAIL_ALL, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWX", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 470: Specified symbol size too small for data", -1 }, // Cols 2 too small - /* 31*/ { BARCODE_MICROPDF417, -1, 3, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKL", ZINT_WARN_INVALID_OPTION, 0, 32, 99, "Warning 471: Specified symbol size too small for data", -1 }, // Cols 3 too small, auto-upped to 4 with warning - /* 32*/ { BARCODE_MICROPDF417, -1, 3, -1, WARN_FAIL_ALL, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKL", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 471: Specified symbol size too small for data", -1 }, // Cols 3 too small - /* 33*/ { BARCODE_PDF417, -1, 1, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, // Cols 1 auto-upped to 2 just fits, now with warning - /* 34*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH", ZINT_WARN_INVALID_OPTION, 0, 67, 120, "Warning 748: Columns increased from 1 to 3", -1 }, // Cols 1 too small with Structured Append, used to fail, now auto-upped to 3 with warning - /* 35*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, // Cols 1 with Structured Append auto-upped to 2 just fits, now with warning - /* 36*/ { BARCODE_PDF417, -1, 1, -1, 0, { 2, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU", ZINT_WARN_INVALID_OPTION, 0, 65, 120, "Warning 748: Columns increased from 1 to 3", -1 }, // Cols 1 too small with Structured Append as last symbol (uses extra terminating codeword), used to fail, now auto-upped to 3 with warning - /* 37*/ { BARCODE_PDF417, -1, 1, -1, 0, { 2, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, // Cols 1 with Structured Append as last symbol just fits with 1 less character pair when auto-upped to 2, now with warning + /* 9*/ { BARCODE_PDF417, -1, 10, -1, 0, { 0, 0, "" }, "12345", 0, 0, 3, 239, "", -1 }, /* ECC auto-set to 2, cols 10 */ + /* 10*/ { BARCODE_PDF417, 9, -1, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 6, 103, "Warning 460: Security value out of range", -1 }, /* Invalid ECC, auto-set */ + /* 11*/ { BARCODE_PDF417, -1, 31, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 6, 103, "Warning 461: Number of columns out of range (1 to 30)", 0 }, /* Invalid cols, auto-set */ + /* 12*/ { BARCODE_PDF417, -1, -1, 2, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 466: Number of rows out of range (3 to 90)", -1 }, /* Invalid rows, error */ + /* 13*/ { BARCODE_PDF417, -1, -1, 91, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 466: Number of rows out of range (3 to 90)", -1 }, /* Invalid rows, error */ + /* 14*/ { BARCODE_PDF417, 9, -1, -1, WARN_FAIL_ALL, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 460: Security value out of range", -1 }, /* Invalid ECC */ + /* 15*/ { BARCODE_PDF417, -1, 31, -1, WARN_FAIL_ALL, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 461: Number of columns out of range (1 to 30)", -1 }, /* Invalid cols */ + /* 16*/ { BARCODE_PDF417, -1, 30, 31, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 475: Columns x rows out of range (1 to 928)", -1 }, /* Rows * cols (930) > 928 */ + /* 17*/ { BARCODE_PDF417, -1, 1, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI", ZINT_WARN_INVALID_OPTION, 0, 65, 120, "Warning 748: Columns increased from 1 to 3", -1 }, /* Cols 1 too small, used to fail, now auto-upped to 3 with warning */ + /* 18*/ { BARCODE_PDF417, -1, -1, 4, 0, { 0, 0, "" }, "12345", 0, 0, 4, 120, "", -1 }, /* Specify rows 4 (cols 3) */ + /* 19*/ { BARCODE_PDF417, -1, 3, 4, 0, { 0, 0, "" }, "12345", 0, 0, 4, 120, "", 0 }, /* Specify cols 3 & rows 4 */ + /* 20*/ { BARCODE_PDF417, -1, -1, 90, 0, { 0, 0, "" }, "12345", 0, 0, 90, 86, "", -1 }, /* Specify rows 90 (cols 1) */ + /* 21*/ { BARCODE_PDF417, 0, -1, 3, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", 0, 0, 3, 579, "", -1 }, /* Specify rows 3, max cols 30 */ + /* 22*/ { BARCODE_PDF417, 0, 30, 3, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", 0, 0, 3, 579, "", 0 }, /* Specify rows 3, cols 30 */ + /* 23*/ { BARCODE_PDF417, 0, 29, 3, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", ZINT_WARN_INVALID_OPTION, 0, 4, 562, "Warning 746: Rows increased from 3 to 4", -1 }, /* Specify rows 3, cols 29, rows auto-upped to 4 */ + /* 24*/ { BARCODE_MICROPDF417, -1, 5, -1, 0, { 0, 0, "" }, "12345", ZINT_WARN_INVALID_OPTION, 0, 11, 38, "Warning 468: Specified width out of range", -1 }, /* Invalid cols, auto-set to 1 */ + /* 25*/ { BARCODE_MICROPDF417, -1, 5, -1, WARN_FAIL_ALL, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 468: Specified width out of range", -1 }, /* Invalid cols */ + /* 26*/ { BARCODE_MICROPDF417, -1, 5, 3, 0, { 0, 0, "" }, "12345", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 476: Cannot specify rows for MicroPDF417", -1 }, /* Rows option not available */ + /* 27*/ { BARCODE_MICROPDF417, -1, 1, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM", ZINT_WARN_INVALID_OPTION, 0, 17, 55, "Warning 469: Specified symbol size too small for data", -1 }, /* Cols 1 too small, auto-upped to 2 with warning */ + /* 28*/ { BARCODE_MICROPDF417, -1, 1, -1, WARN_FAIL_ALL, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 469: Specified symbol size too small for data", -1 }, /* Cols 1 too small */ + /* 29*/ { BARCODE_MICROPDF417, -1, 2, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWX", ZINT_WARN_INVALID_OPTION, 0, 15, 99, "Warning 470: Specified symbol size too small for data", -1 }, /* Cols 2 too small, auto-upped to 4 with warning */ + /* 30*/ { BARCODE_MICROPDF417, -1, 2, -1, WARN_FAIL_ALL, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWX", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 470: Specified symbol size too small for data", -1 }, /* Cols 2 too small */ + /* 31*/ { BARCODE_MICROPDF417, -1, 3, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKL", ZINT_WARN_INVALID_OPTION, 0, 32, 99, "Warning 471: Specified symbol size too small for data", -1 }, /* Cols 3 too small, auto-upped to 4 with warning */ + /* 32*/ { BARCODE_MICROPDF417, -1, 3, -1, WARN_FAIL_ALL, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKL", ZINT_ERROR_INVALID_OPTION, 0, 0, 0, "Error 471: Specified symbol size too small for data", -1 }, /* Cols 3 too small */ + /* 33*/ { BARCODE_PDF417, -1, 1, -1, 0, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, /* Cols 1 auto-upped to 2 just fits, now with warning */ + /* 34*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH", ZINT_WARN_INVALID_OPTION, 0, 67, 120, "Warning 748: Columns increased from 1 to 3", -1 }, /* Cols 1 too small with Structured Append, used to fail, now auto-upped to 3 with warning */ + /* 35*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, /* Cols 1 with Structured Append auto-upped to 2 just fits, now with warning */ + /* 36*/ { BARCODE_PDF417, -1, 1, -1, 0, { 2, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU", ZINT_WARN_INVALID_OPTION, 0, 65, 120, "Warning 748: Columns increased from 1 to 3", -1 }, /* Cols 1 too small with Structured Append as last symbol (uses extra terminating codeword), used to fail, now auto-upped to 3 with warning */ + /* 37*/ { BARCODE_PDF417, -1, 1, -1, 0, { 2, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, /* Cols 1 with Structured Append as last symbol just fits with 1 less character pair when auto-upped to 2, now with warning */ /* 38*/ { BARCODE_PDF417, -1, 1, -1, 0, { 3, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 741: Structured Append index out of range (1-2)", -1 }, /* 39*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 1, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 740: Structured Append count out of range (2-99999)", -1 }, /* 40*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 100000, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 740: Structured Append count out of range (2-99999)", -1 }, /* 41*/ { BARCODE_PDF417, -1, 1, -1, 0, { 0, 2, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 741: Structured Append index out of range (1-2)", -1 }, - /* 42*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "1" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, // Now with warning - /* 43*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "123123" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, // Now with warning - /* 44*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "123123123123123123123123123123" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, // Now with warning + /* 42*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "1" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, /* Now with warning */ + /* 43*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "123123" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, /* Now with warning */ + /* 44*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "123123123123123123123123123123" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, /* Now with warning */ /* 45*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "1231231231231231231231231231231" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 742: Structured Append ID too long (30 digit maximum)", -1 }, - /* 46*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "23123123123123123123123123123" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, // Now with warning + /* 46*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "23123123123123123123123123123" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_WARN_INVALID_OPTION, 0, 89, 103, "Warning 748: Columns increased from 1 to 2", -1 }, /* Now with warning */ /* 47*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "A" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 743: Invalid Structured Append ID (digits only)", -1 }, /* 48*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "900" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 744: Structured Append ID triplet 1 '900' out of range (000-899)", -1 }, /* 49*/ { BARCODE_PDF417, -1, 1, -1, 0, { 1, 2, "123123123123123123123123901123" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 744: Structured Append ID triplet 9 '901' out of range (000-899)", -1 }, - /* 50*/ { BARCODE_MICROPDF417, -1, -1, -1, 0, { 1, 2, "1231231231231231231231231231231" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 742: Structured Append ID too long (30 digit maximum)", -1 }, // Micro PDF417 same error checking code + /* 50*/ { BARCODE_MICROPDF417, -1, -1, -1, 0, { 1, 2, "1231231231231231231231231231231" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH", ZINT_ERROR_INVALID_OPTION, -1, 0, 0, "Error 742: Structured Append ID too long (30 digit maximum)", -1 }, /* Micro PDF417 same error checking code */ }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -195,7 +196,7 @@ static void test_options(int index, int debug) { assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); if (data[i].option_3 != -1) { - assert_equal(symbol->option_3, data[i].option_3, "i:%d symbol->option_3 %d != %d\n", i, symbol->option_3, data[i].option_3); // Unchanged + assert_equal(symbol->option_3, data[i].option_3, "i:%d symbol->option_3 %d != %d\n", i, symbol->option_3, data[i].option_3); /* Unchanged */ } else { assert_zero(symbol->option_3, "i:%d symbol->option_3 %d != 0\n", i, symbol->option_3); } @@ -235,7 +236,7 @@ static void test_reader_init(int index, int generate, int debug) { char *comment; }; struct item data[] = { - /* 0*/ { BARCODE_PDF417, UNICODE_MODE, READER_INIT, "A", 0, 6, 103, "(12) 4 921 900 29 60 257 719 198 75 123 199 98", "Outputs Test Alpha flag 900" }, + /* 0*/ { BARCODE_PDF417, UNICODE_MODE, READER_INIT, "A", 0, 6, 103, "(12) 4 921 29 900 209 917 46 891 522 472 822 385", "Outputs Test Alpha flag 900" }, /* 1*/ { BARCODE_MICROPDF417, UNICODE_MODE, READER_INIT, "A", 0, 11, 38, "(11) 921 900 29 900 179 499 922 262 777 478 300", "Outputs Test Alpha flag 900" }, }; int data_size = ARRAY_SIZE(data); @@ -243,6 +244,10 @@ static void test_reader_init(int index, int generate, int debug) { struct zint_symbol *symbol; char escaped[1024]; + char cmp_buf[32768]; + char cmp_msg[1024]; + + int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); /* Only do ZXing-C++ test if asked, too slow otherwise */ testStart("test_reader_init"); @@ -253,7 +258,7 @@ static void test_reader_init(int index, int generate, int debug) { symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - symbol->debug = ZINT_DEBUG_TEST; // Needed to get codeword dump in errtxt + symbol->debug = ZINT_DEBUG_TEST; /* Needed to get codeword dump in errtxt */ length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug); @@ -271,6 +276,20 @@ static void test_reader_init(int index, int generate, int debug) { assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); } assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); + + if (ret < ZINT_ERROR) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { + int cmp_len, ret_len; + char modules_dump[32768]; + assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); + assert_zero(ret, "i:%d %s testUtilZXingCPPCmp %d != 0 %s\n actual: %.*s\nexpected: %.*s\n", + i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, ret_len, escaped); + } + } } ZBarcode_Delete(symbol); @@ -294,65 +313,71 @@ static void test_input(int index, int generate, int debug) { int expected_rows; int expected_width; char *expected; + int bwipp_cmp; char *comment; }; - // é U+00E9 (\351, 233), UTF-8 C3A9 - // β U+03B2 in ISO 8859-7 Greek (but not other ISO 8859 or Win page) (\342, 226), UTF-8 CEB2 + /* é U+00E9 (\351, 233), UTF-8 C3A9 */ + /* β U+03B2 in ISO 8859-7 Greek (but not other ISO 8859 or Win page) (\342, 226), UTF-8 CEB2 */ struct item data[] = { - /* 0*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "é", 0, 0, 6, 103, "(12) 4 913 233 900 398 878 279 350 217 295 231 77", "" }, - /* 1*/ { BARCODE_PDF417, UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "é", 0, 3, 7, 103, "(14) 6 927 3 913 233 900 162 81 551 529 607 384 164 108", "" }, - /* 2*/ { BARCODE_PDF417, UNICODE_MODE, 26, -1, -1, { 0, 0, "" }, "é", 0, 26, 7, 103, "(14) 6 927 26 901 195 169 574 701 519 908 84 241 360 642", "" }, - /* 3*/ { BARCODE_PDF417, UNICODE_MODE, 9, -1, -1, { 0, 0, "" }, "β", 0, 9, 7, 103, "(14) 6 927 9 913 226 900 487 92 418 278 838 500 576 84", "" }, - /* 4*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "β", ZINT_WARN_USES_ECI, 9, 7, 103, "Warning (14) 6 927 9 913 226 900 487 92 418 278 838 500 576 84", "" }, - /* 5*/ { BARCODE_PDF417, UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "β", ZINT_ERROR_INVALID_DATA, 3, 0, 0, "Error 244: Invalid character in input data for ECI 3", "" }, - /* 6*/ { BARCODE_PDF417, UNICODE_MODE, 899, -1, -1, { 0, 0, "" }, "A", 0, 899, 7, 103, "(14) 6 927 899 900 29 900 727 69 915 482 371 771 641 35", "" }, - /* 7*/ { BARCODE_PDF417, UNICODE_MODE, 900, -1, -1, { 0, 0, "" }, "A", 0, 900, 7, 103, "(14) 6 926 0 0 900 29 56 795 921 763 468 267 410 129", "" }, - /* 8*/ { BARCODE_PDF417, UNICODE_MODE, 810899, -1, -1, { 0, 0, "" }, "A", 0, 810899, 7, 103, "(14) 6 926 899 899 900 29 847 901 749 718 89 792 660 273", "" }, - /* 9*/ { BARCODE_PDF417, UNICODE_MODE, 810900, -1, -1, { 0, 0, "" }, "A", 0, 810900, 7, 103, "(14) 6 925 0 900 29 900 652 613 857 390 38 450 415 899", "" }, - /* 10*/ { BARCODE_PDF417, UNICODE_MODE, 811799, -1, -1, { 0, 0, "" }, "A", 0, 811799, 7, 103, "(14) 6 925 899 900 29 900 456 300 328 160 510 753 157 159", "" }, - /* 11*/ { BARCODE_PDF417, UNICODE_MODE, 811800, -1, -1, { 0, 0, "" }, "A", ZINT_ERROR_INVALID_OPTION, 811800, 0, 0, "Error 472: Invalid ECI", "" }, - /* 12*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "é", 0, 0, 11, 38, "(11) 913 233 900 900 805 609 847 211 598 4 603", "" }, - /* 13*/ { BARCODE_MICROPDF417, UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "é", 0, 3, 11, 38, "(11) 927 3 913 233 803 477 85 249 824 813 830", "" }, - /* 14*/ { BARCODE_MICROPDF417, UNICODE_MODE, 26, -1, -1, { 0, 0, "" }, "é", 0, 26, 6, 82, "(18) 927 26 901 195 169 900 288 96 509 365 709 784 713 403 219 81 851 866", "" }, - /* 15*/ { BARCODE_MICROPDF417, UNICODE_MODE, 9, -1, -1, { 0, 0, "" }, "β", 0, 9, 11, 38, "(11) 927 9 913 226 23 103 74 194 394 667 324", "" }, - /* 16*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "β", ZINT_WARN_USES_ECI, 9, 11, 38, "Warning (11) 927 9 913 226 23 103 74 194 394 667 324", "" }, - /* 17*/ { BARCODE_MICROPDF417, UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "β", ZINT_ERROR_INVALID_DATA, 3, 0, 0, "Error 244: Invalid character in input data for ECI 3", "" }, - /* 18*/ { BARCODE_MICROPDF417, UNICODE_MODE, 899, -1, -1, { 0, 0, "" }, "A", 0, 899, 11, 38, "(11) 927 899 900 29 533 437 884 3 617 241 747", "" }, - /* 19*/ { BARCODE_MICROPDF417, UNICODE_MODE, 900, -1, -1, { 0, 0, "" }, "A", 0, 900, 6, 82, "(18) 926 0 0 900 29 900 913 543 414 141 214 886 461 1 419 422 54 495", "" }, - /* 20*/ { BARCODE_MICROPDF417, UNICODE_MODE, 810899, -1, -1, { 0, 0, "" }, "A", 0, 810899, 6, 82, "(18) 926 899 899 900 29 900 351 555 241 509 787 583 3 326 41 628 534 151", "" }, - /* 21*/ { BARCODE_MICROPDF417, UNICODE_MODE, 810900, -1, -1, { 0, 0, "" }, "A", 0, 810900, 11, 38, "(11) 925 0 900 29 233 533 43 483 708 659 704", "" }, - /* 22*/ { BARCODE_MICROPDF417, UNICODE_MODE, 811800, -1, -1, { 0, 0, "" }, "A", ZINT_ERROR_INVALID_OPTION, 811800, 0, 0, "Error 472: Invalid ECI", "" }, - /* 23*/ { BARCODE_HIBC_PDF, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, ",", ZINT_ERROR_INVALID_DATA, 0, 0, 0, "Error 203: Invalid character in data (alphanumerics, space and \"-.$/+%\" only)", "" }, - /* 24*/ { BARCODE_HIBC_MICPDF, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, ",", ZINT_ERROR_INVALID_DATA, 0, 0, 0, "Error 203: Invalid character in data (alphanumerics, space and \"-.$/+%\" only)", "" }, - /* 25*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "AB{} C#+ de{} {}F 12{} G{} H", 0, 0, 12, 120, "(36) 28 1 865 807 896 782 855 626 807 94 865 807 896 808 776 839 176 808 32 776 839 806 208", "" }, - /* 26*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "{} #+ de{} 12{} {} H", 0, 0, 10, 120, "(30) 22 865 807 896 808 470 807 94 865 807 896 808 32 776 839 806 865 807 896 787 900 900", "" }, - /* 27*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", "" }, - /* 28*/ { BARCODE_PDF417, UNICODE_MODE, -1, 0, -1, { 0, 0, "" }, "A", 0, 0, 4, 86, "(4) 2 29 347 502", "" }, - /* 29*/ { BARCODE_PDF417, UNICODE_MODE, -1, 1, -1, { 0, 0, "" }, "A", 0, 0, 6, 86, "(6) 2 29 752 533 551 139", "" }, - /* 30*/ { BARCODE_PDF417, UNICODE_MODE, -1, 2, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", "" }, - /* 31*/ { BARCODE_PDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, "A", 0, 0, 9, 103, "(18) 2 29 290 888 64 789 390 182 22 197 347 41 298 467 387 917 455 196", "" }, - /* 32*/ { BARCODE_PDF417, UNICODE_MODE, -1, 4, -1, { 0, 0, "" }, "A", 0, 0, 12, 120, "(36) 4 29 900 900 702 212 753 721 695 584 222 459 110 594 813 465 718 912 667 349 852 602", "" }, - /* 33*/ { BARCODE_PDF417, UNICODE_MODE, -1, 5, -1, { 0, 0, "" }, "A", 0, 0, 14, 154, "(70) 6 29 900 900 900 900 774 599 527 418 850 374 921 763 922 772 572 661 584 902 578 696", "" }, - /* 34*/ { BARCODE_PDF417, UNICODE_MODE, -1, 6, -1, { 0, 0, "" }, "A", 0, 0, 19, 188, "(133) 5 29 900 900 900 113 261 822 368 600 652 404 869 860 902 184 702 611 323 195 794 566", "" }, - /* 35*/ { BARCODE_PDF417, UNICODE_MODE, -1, 7, -1, { 0, 0, "" }, "A", 0, 0, 29, 222, "(261) 5 29 900 900 900 384 614 456 20 422 177 78 492 215 859 765 864 755 572 621 891 97 538", "" }, - /* 36*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 0, 0, "" }, "A", 0, 0, 40, 290, "(520) 8 29 900 900 900 900 900 900 255 576 871 499 885 500 866 196 784 681 589 448 428 108", "" }, - /* 37*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", "H.4 example" }, - /* 38*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", "H.4 example last segment" }, - /* 39*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", "No ID" }, - /* 40*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", "IDs '123', '045'" }, - /* 41*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", "H.4 example" }, - /* 42*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 4, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 928 111 103 17 53 923 1 111 104 922 837 837 774 835 701 445 926 428 285 851 334", "H.4 example last segment" }, - /* 43*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", "No ID" }, - /* 44*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", "IDs '100', '200', '300'" }, - /* 45*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 902 1 348 256 900 759 577 359 263 64 409 852 154", "" }, - /* 46*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", "" }, - /* 47*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", "" }, + /* 0*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "é", 0, 0, 6, 103, "(12) 4 913 233 900 398 878 279 350 217 295 231 77", 1, "" }, + /* 1*/ { BARCODE_PDF417, UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "é", 0, 3, 7, 103, "(14) 6 927 3 913 233 900 162 81 551 529 607 384 164 108", 1, "" }, + /* 2*/ { BARCODE_PDF417, UNICODE_MODE, 26, -1, -1, { 0, 0, "" }, "é", 0, 26, 7, 103, "(14) 6 927 26 901 195 169 574 701 519 908 84 241 360 642", 1, "" }, + /* 3*/ { BARCODE_PDF417, UNICODE_MODE, 9, -1, -1, { 0, 0, "" }, "β", 0, 9, 7, 103, "(14) 6 927 9 913 226 900 487 92 418 278 838 500 576 84", 1, "" }, + /* 4*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "β", ZINT_WARN_USES_ECI, 9, 7, 103, "Warning (14) 6 927 9 913 226 900 487 92 418 278 838 500 576 84", 1, "" }, + /* 5*/ { BARCODE_PDF417, UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "β", ZINT_ERROR_INVALID_DATA, 3, 0, 0, "Error 244: Invalid character in input data for ECI 3", 1, "" }, + /* 6*/ { BARCODE_PDF417, UNICODE_MODE, 899, -1, -1, { 0, 0, "" }, "A", 0, 899, 6, 103, "(12) 4 927 899 29 567 272 3 384 796 210 839 746", 0, "BWIPP BYTE1" }, + /* 7*/ { BARCODE_PDF417, UNICODE_MODE, 900, -1, -1, { 0, 0, "" }, "A", 0, 900, 7, 103, "(14) 6 926 0 0 29 900 205 526 248 527 915 616 104 416", 0, "BWIPP BYTE1" }, + /* 8*/ { BARCODE_PDF417, UNICODE_MODE, 810899, -1, -1, { 0, 0, "" }, "A", 0, 810899, 7, 103, "(14) 6 926 899 899 29 900 67 632 76 482 536 212 354 560", 0, "BWIPP BYTE1" }, + /* 9*/ { BARCODE_PDF417, UNICODE_MODE, 810900, -1, -1, { 0, 0, "" }, "A", 0, 810900, 6, 103, "(12) 4 925 0 29 682 61 599 519 256 742 797 153", 0, "BWIPP BYTE1" }, + /* 10*/ { BARCODE_PDF417, UNICODE_MODE, 811799, -1, -1, { 0, 0, "" }, "A", 0, 811799, 6, 103, "(12) 4 925 899 29 447 238 770 706 58 39 749 743", 0, "BWIPP BYTE1" }, + /* 11*/ { BARCODE_PDF417, UNICODE_MODE, 811800, -1, -1, { 0, 0, "" }, "A", ZINT_ERROR_INVALID_OPTION, 811800, 0, 0, "Error 472: Invalid ECI", 1, "" }, + /* 12*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "é", 0, 0, 11, 38, "(11) 901 233 900 900 310 142 569 141 677 300 494", 1, "" }, + /* 13*/ { BARCODE_MICROPDF417, UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "é", 0, 3, 11, 38, "(11) 927 3 901 233 657 863 824 246 172 292 833", 1, "" }, + /* 14*/ { BARCODE_MICROPDF417, UNICODE_MODE, 26, -1, 3, { 0, 0, "" }, "é", 0, 26, 6, 82, "(18) 927 26 901 195 169 900 288 96 509 365 709 784 713 403 219 81 851 866", 1, "" }, + /* 15*/ { BARCODE_MICROPDF417, UNICODE_MODE, 9, -1, -1, { 0, 0, "" }, "β", 0, 9, 11, 38, "(11) 927 9 901 226 806 489 813 191 671 146 327", 1, "" }, + /* 16*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "β", ZINT_WARN_USES_ECI, 9, 11, 38, "Warning (11) 927 9 901 226 806 489 813 191 671 146 327", 1, "" }, + /* 17*/ { BARCODE_MICROPDF417, UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "β", ZINT_ERROR_INVALID_DATA, 3, 0, 0, "Error 244: Invalid character in input data for ECI 3", 1, "" }, + /* 18*/ { BARCODE_MICROPDF417, UNICODE_MODE, 899, -1, -1, { 0, 0, "" }, "A", 0, 899, 11, 38, "(11) 927 899 900 29 533 437 884 3 617 241 747", 0, "BWIPP BYTE" }, + /* 19*/ { BARCODE_MICROPDF417, UNICODE_MODE, 900, -1, -1, { 0, 0, "" }, "A", 0, 900, 6, 82, "(18) 926 0 0 900 29 900 913 543 414 141 214 886 461 1 419 422 54 495", 0, "BWIPP BYTE" }, + /* 20*/ { BARCODE_MICROPDF417, UNICODE_MODE, 810899, -1, -1, { 0, 0, "" }, "A", 0, 810899, 6, 82, "(18) 926 899 899 900 29 900 351 555 241 509 787 583 3 326 41 628 534 151", 0, "BWIPP BYTE" }, + /* 21*/ { BARCODE_MICROPDF417, UNICODE_MODE, 810900, -1, -1, { 0, 0, "" }, "A", 0, 810900, 11, 38, "(11) 925 0 900 29 233 533 43 483 708 659 704", 0, "BWIPP BYTE" }, + /* 22*/ { BARCODE_MICROPDF417, UNICODE_MODE, 811800, -1, -1, { 0, 0, "" }, "A", ZINT_ERROR_INVALID_OPTION, 811800, 0, 0, "Error 472: Invalid ECI", 0, "BWIPP BYTE" }, + /* 23*/ { BARCODE_HIBC_PDF, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, ",", ZINT_ERROR_INVALID_DATA, 0, 0, 0, "Error 203: Invalid character in data (alphanumerics, space and \"-.$/+%\" only)", 1, "" }, + /* 24*/ { BARCODE_HIBC_MICPDF, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, ",", ZINT_ERROR_INVALID_DATA, 0, 0, 0, "Error 203: Invalid character in data (alphanumerics, space and \"-.$/+%\" only)", 1, "" }, + /* 25*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "AB{} C#+ de{} {}F 12{} G{} H", 0, 0, 12, 120, "(36) 28 1 865 807 896 782 855 626 807 94 865 807 896 808 776 839 176 808 32 776 839 806 208", 0, "BWIPP different encodation (1 codeword shorter)" }, + /* 26*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "{} #+ de{} 12{} {} H", 0, 0, 10, 120, "(30) 22 865 807 896 808 470 807 94 865 807 896 808 32 776 839 806 865 807 896 787 900 900", 0, "BWIPP different encodation" }, + /* 27*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", 0, "BWIPP BYTE1" }, + /* 28*/ { BARCODE_PDF417, UNICODE_MODE, -1, 0, -1, { 0, 0, "" }, "A", 0, 0, 4, 86, "(4) 2 29 347 502", 0, "BWIPP BYTE1" }, + /* 29*/ { BARCODE_PDF417, UNICODE_MODE, -1, 1, -1, { 0, 0, "" }, "A", 0, 0, 6, 86, "(6) 2 29 752 533 551 139", 0, "BWIPP BYTE1" }, + /* 30*/ { BARCODE_PDF417, UNICODE_MODE, -1, 2, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", 0, "BWIPP BYTE1" }, + /* 31*/ { BARCODE_PDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, "A", 0, 0, 9, 103, "(18) 2 29 290 888 64 789 390 182 22 197 347 41 298 467 387 917 455 196", 0, "BWIPP BYTE1" }, + /* 32*/ { BARCODE_PDF417, UNICODE_MODE, -1, 4, -1, { 0, 0, "" }, "A", 0, 0, 12, 120, "(36) 4 29 900 900 702 212 753 721 695 584 222 459 110 594 813 465 718 912 667 349 852 602", 0, "BWIPP BYTE1" }, + /* 33*/ { BARCODE_PDF417, UNICODE_MODE, -1, 5, -1, { 0, 0, "" }, "A", 0, 0, 14, 154, "(70) 6 29 900 900 900 900 774 599 527 418 850 374 921 763 922 772 572 661 584 902 578 696", 0, "BWIPP BYTE1" }, + /* 34*/ { BARCODE_PDF417, UNICODE_MODE, -1, 6, -1, { 0, 0, "" }, "A", 0, 0, 19, 188, "(133) 5 29 900 900 900 113 261 822 368 600 652 404 869 860 902 184 702 611 323 195 794 566", 0, "BWIPP BYTE1" }, + /* 35*/ { BARCODE_PDF417, UNICODE_MODE, -1, 7, -1, { 0, 0, "" }, "A", 0, 0, 29, 222, "(261) 5 29 900 900 900 384 614 456 20 422 177 78 492 215 859 765 864 755 572 621 891 97 538", 0, "BWIPP BYTE1" }, + /* 36*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 0, 0, "" }, "A", 0, 0, 40, 290, "(520) 8 29 900 900 900 900 900 900 255 576 871 499 885 500 866 196 784 681 589 448 428 108", 0, "BWIPP BYTE1" }, + /* 37*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" }, + /* 38*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" }, + /* 39*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" }, + /* 40*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" }, + /* 41*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" }, + /* 42*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 4, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 928 111 103 17 53 923 1 111 104 922 837 837 774 835 701 445 926 428 285 851 334", 1, "H.4 example last segment" }, + /* 43*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" }, + /* 44*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" }, + /* 45*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 902 1 348 256 900 759 577 359 263 64 409 852 154", 0, "BWIPP BYTE" }, + /* 46*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" }, + /* 47*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; struct zint_symbol *symbol; char escaped[1024]; + char cmp_buf[32768]; + char cmp_msg[1024]; + + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */ + int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); /* Only do ZXing-C++ test if asked, too slow otherwise */ testStart("test_input"); @@ -363,7 +388,7 @@ static void test_input(int index, int generate, int debug) { symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - symbol->debug = ZINT_DEBUG_TEST; // Needed to get codeword dump in errtxt + symbol->debug = ZINT_DEBUG_TEST; /* Needed to get codeword dump in errtxt */ length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); if (data[i].structapp.count) { @@ -374,11 +399,11 @@ static void test_input(int index, int generate, int debug) { 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, %d, %d, %d, { %d, %d, \"%s\" }, \"%s\", %s, %d, %d, %d, \"%s\", \"%s\" },\n", + printf(" /*%3d*/ { %s, %s, %d, %d, %d, { %d, %d, \"%s\" }, \"%s\", %s, %d, %d, %d, \"%s\", %d, \"%s\" },\n", i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), data[i].eci, data[i].option_1, data[i].option_2, data[i].structapp.index, data[i].structapp.count, data[i].structapp.id, testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), testUtilErrorName(data[i].ret), - symbol->eci, symbol->rows, symbol->width, symbol->errtxt, data[i].comment); + symbol->eci, symbol->rows, symbol->width, symbol->errtxt, data[i].bwipp_cmp, data[i].comment); } else { if (ret < ZINT_ERROR) { assert_equal(symbol->eci, data[i].expected_eci, "i:%d symbol->eci %d != %d (%s)\n", i, symbol->eci, data[i].expected_eci, data[i].data); @@ -386,6 +411,34 @@ static void test_input(int index, int generate, int debug) { assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); } assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); + + if (ret < ZINT_ERROR) { + if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, debug)) { + if (!data[i].bwipp_cmp) { + if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); + } else { + char modules_dump[32768]; + assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); + ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, data[i].data, length, NULL, cmp_buf, sizeof(cmp_buf), NULL); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilBwippCmp(symbol, cmp_msg, cmp_buf, modules_dump); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, modules_dump); + } + } + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { + int cmp_len, ret_len; + char modules_dump[32768]; + assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); + assert_zero(ret, "i:%d %s testUtilZXingCPPCmp %d != 0 %s\n actual: %.*s\nexpected: %.*s\n", + i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, ret_len, escaped); + } + } } ZBarcode_Delete(symbol); @@ -508,27 +561,27 @@ static void test_encode(int index, int generate, int debug) { "1111111101010100011101000011111010111111010001101001011000010011100010010101111000000111111101000101001" "1111111101010100011001011011100000110011001100001101100100101100000011110010100011110111111101000101001" }, - /* 7*/ { BARCODE_PDF417, -1, UNICODE_MODE, 4, 2, -1, "\015\015\015\015\010\015", 0, 20, 103, 0, "Text Compaction Punctuation 1 Mixed -> Text Byte; BWIPP uses Byte only", - "1111111101010100011010100011000000110101000011000001110001110110110011110101011110000111111101000101001" - "1111111101010100011110101101100000101100101111110001111001000110110011111010100011000111111101000101001" - "1111111101010100011101010111111000110011111101100101010100001111000011010110111111000111111101000101001" - "1111111101010100011110100101111000111010110111100001000011000110010010101111001111000111111101000101001" - "1111111101010100011110101111011110111001011100110001010011110010000011010111000010000111111101000101001" - "1111111101010100011110101111010000110011111001000101011100100110000011010111111010000111111101000101001" - "1111111101010100011010011100011110110010001100011101000100111000111011010011101111000111111101000101001" - "1111111101010100011111010010001100111000110011101001111000100001010011110100101000000111111101000101001" - "1111111101010100011010011011111100110001110010011101000001111010100011111010011100010111111101000101001" - "1111111101010100010100011100111000100001101100000101101000110011100011010001100011100111111101000101001" - "1111111101010100011010011110110000110010000111000101110100110000100011010011100010000111111101000101001" - "1111111101010100010100010001111000100000101101111101000111010000110011111010001110010111111101000101001" - "1111111101010100011101000001011100111100110100111001011110001111001010100001100000110111111101000101001" - "1111111101010100011101000110010000111000001101110101101011110000011011110100010001000111111101000101001" - "1111111101010100011101000011111010101101000111000001101111000001011011001010011111000111111101000101001" - "1111111101010100011100101101111000100001100110010001010011000110000011110010100011110111111101000101001" - "1111111101010100011111010000101100111000001011101101000101111000001010100011110000010111111101000101001" - "1111111101010100010010111011111100111000110101111101101110100011100011001011111101000111111101000101001" - "1111111101010100011101101000011000100000100011001101011001111101111011111011010011110111111101000101001" - "1111111101010100011110100000110110111110111011001001111100001010011010100001111101100111111101000101001" + /* 7*/ { BARCODE_PDF417, -1, UNICODE_MODE, 4, 2, -1, "\015\015\015\015\010\015", 0, 20, 103, 1, "Text Compaction Punctuation 1 Mixed -> Byte", + "1111111101010100011010100011000000110101000011000001100011100011010011110101011110000111111101000101001" + "1111111101010100011110101101100000111110101100011101110111101111101011111010100011000111111101000101001" + "1111111101010100011101010111111000110100111111001001001111000101000011010110111111000111111101000101001" + "1111111101010100011110100101111000111000101100111101000011000110010010101111001111000111111101000101001" + "1111111101010100011110101111011110111001000110000101111101010000110011010111000010000111111101000101001" + "1111111101010100011110101111010000100001111001101101000111100101000011010111111010000111111101000101001" + "1111111101010100011010011100011110110001001001100001110100001001110011010011101111000111111101000101001" + "1111111101010100011111010010001100111000101100001001111001010010000011110100101000000111111101000101001" + "1111111101010100011010011011111100101000110111110001001110000001011011111010011100010111111101000101001" + "1111111101010100010100011100111000110101000011000001100011010100000011010001100011100111111101000101001" + "1111111101010100011010011110110000111101000111011101011100010011111011010011100010000111111101000101001" + "1111111101010100010100010001111000111110110011110101011110000010001011111010001110010111111101000101001" + "1111111101010100011101000001011100100101100000110001100010000110111010100001100000110111111101000101001" + "1111111101010100011101000110010000111100110011000101111001000110011011110100010001000111111101000101001" + "1111111101010100011101000011111010101110111000111101100010101111100011001010011111000111111101000101001" + "1111111101010100011100101101111000111110101011111001110001100010011011110010100011110111111101000101001" + "1111111101010100011111010000101100101111100100111001100001011101000010100011110000010111111101000101001" + "1111111101010100010010111011111100100011000010011101001001000011110011001011111101000111111101000101001" + "1111111101010100011101101000011000111010111011111001011001111000111011111011010011110111111101000101001" + "1111111101010100011110100000110110100111111011011101101110001111101010100001111101100111111101000101001" }, /* 8*/ { BARCODE_PDF417, -1, UNICODE_MODE, 4, 3, -1, "??????ABCDEFG??????abcdef??????%%%%%%", 0, 19, 120, 1, "Text Compaction Punctuation Alpha Punctuation Lower Punctuation Mixed", "111111110101010001101010001100000011010111001111000100011101110010001100111000110010011111010101111100111111101000101001" @@ -551,14 +604,17 @@ static void test_encode(int index, int generate, int debug) { "111111110101010001111100101110010010011100000100110100111010000110001100110100001111011100101111100010111111101000101001" "111111110101010001110110100001100010011001111001110101111011110001001011011100011000011011010001000000111111101000101001" }, - /* 9*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, ";;;;;é;;;;;", 0, 7, 120, 0, "BWIPP different encodation", - "111111110101010001111101010111110011101011011110000100011101110010001110101011100000011111010101111100111111101000101001" - "111111110101010001111101010001100011111010101100000111110101110111101011111100100011011110101001000000111111101000101001" - "111111110101010001010100111100000010110010000001110110001111100100101000000110100111011010100011111000111111101000101001" - "111111110101010001101011110011111011101010111000000111010101110000001010111101111000011010111100111110111111101000101001" - "111111110101010001101011100001000010111111010110000111000011011101001100001011110110011110101110011100111111101000101001" - "111111110101010001111101011110110010111000110001110111011111100100101111101001111011011110101111000010111111101000101001" - "111111110101010001110100111011111010110011001000000100001100110001001001110011100100011101001110111110111111101000101001" + /* 9*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, ";;;;;é;;;;;", 0, 10, 103, 0, "BWIPP different encodation", + "1111111101010100011101010011100000110101101110000001000111011100100011110101011110000111111101000101001" + "1111111101010100011111010100011000111110101011000001111101010110000011111010100110000111111101000101001" + "1111111101010100011101010111111000101011100011111101001111110011101011010100011111000111111101000101001" + "1111111101010100010101111101111100111101100101110001000111011100100010101111001111000111111101000101001" + "1111111101010100011010111000010000111110101011000001111101010110000011010111000100000111111101000101001" + "1111111101010100011110101111010000101011100011111101100011111001001011110101111000010111111101000101001" + "1111111101010100010100111001110000111011110011010001111010010111100011010011101111000111111101000101001" + "1111111101010100011110100101000000111111011010011001111000001010001011010111111011110111111101000101001" + "1111111101010100011010011011111100110111100110011101001101000001110010100110001111100111111101000101001" + "1111111101010100010100011000001100100010001110111001001010000010000011010001100011100111111101000101001" }, /* 10*/ { BARCODE_PDF417, -1, UNICODE_MODE, 2, 3, -1, "12345678901234", 0, 5, 120, 1, "Numeric Compaction", "111111110101010001111010101111000011101010001110000100111101111010001001011100001110011111010101111100111111101000101001" @@ -732,13 +788,14 @@ static void test_encode(int index, int generate, int debug) { "1111111101010100011100100110100000110101111011000001100110011110100010000010001111010111001011001000001001000011110100011110110110100000111111101000101001" "1111111101010100010110001110111110111110001011100101111101100111101010000111010110000110110010111100001111101011100100010110000011011110111111101000101001" }, - /* 26*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, 5, -1, "ABCDEF1234567890123\177\177\177\177YZ1234567890123", 0, 6, 154, 1, "Text, Numeric, Byte, 2 Text, Numeric", - "1111111101010100011110101011110000110101110111100001111010101111000010100111001110000110100000101100001001111011110100011110101001111000111111101000101001" - "1111111101010100011110101000010000111101011001100001010011110000100011111100011101010110000010111000101111001011011000011111101010111000111111101000101001" - "1111111101010100011101010011111100100000111100101001111011011111010010011100001001100100110001000011101110100011111001010101000011110000111111101000101001" - "1111111101010100010101111001111000101101111011100001001111011110100011110101100111110110100001000011001000001001101100011111010111111010111111101000101001" - "1111111101010100011010111000001000110000010111000101111001011011000010110001111101000111010011100011001110110111010000011101011100110000111111101000101001" - "1111111101010100011111010111100110100001100110111101100110101111000010110011011110000111011100010111101001001001111000011110101111101100111111101000101001" + /* 26*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, 5, -1, "ABCDEF1234567890123\177\177\177\177YZ1234567890123", 0, 7, 154, 0, "Text, Numeric, Byte, 2 Text, Numeric; BWIPP different encodation", + "1111111101010100011111010101111100101011100011100001111010101111000010100111001110000110100000101100001001111011110100011110101001111000111111101000101001" + "1111111101010100011111010100011000111101011001100001010011110000100011111100011101010110000010111000101111001011011000011110101001000000111111101000101001" + "1111111101010100011101010011111100110011111101100101010000001011110010100000010111100101000000101111001010000001011110011010100011111000111111101000101001" + "1111111101010100011010111100111110100001100011001001100111001110011010011110111101000111101011001111101101000010000110011111010111111010111111101000101001" + "1111111101010100011010111000010000111111000111010101100000101110001011110010110110000101111110101100001011111101011000011110101110011100111111101000101001" + "1111111101010100011111010111100110110001111100100101100011111001001010011100101100000110011101011100001111010111110110011110101111000010111111101000101001" + "1111111101010100011101001110111110110001001100011101010000111000111011101010011100000110100010001100001110111100110001011010011100111100111111101000101001" }, /* 27*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ", 0, 14, 154, 1, "ECC 3", "1111111101010100011110101001111000111010011001111001111010101111000010100111001110000110100000101100001111011010000111011110101001111000111111101000101001" @@ -1644,6 +1701,379 @@ static void test_encode(int index, int generate, int debug) { "110100100011100011101100110111010111001111101001111010100001000110110001110100110111100011011001101" "110101100011001000011101000111110100101100001011111010110101111101110001101101111010000011011011101" }, + /* 73*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "123\035", 0, 7, 103, 1, "MR #151 NUM BYTE1", + "1111111101010100011111010101111100110101000110000001000001000010001011110101011110000111111101000101001" + "1111111101010100011111010100011000111010111100011101010111100001000011110101001000000111111101000101001" + "1111111101010100011101010111111000101001001111000001010111000111111011010100011111000111111101000101001" + "1111111101010100011010111100111110110011110111000101100001011000111010101111001111000111111101000101001" + "1111111101010100011010111000010000111110110001001001000100001111001011110101110011100111111101000101001" + "1111111101010100011110101111010000110001100101111001000111100010010011110101111000010111111101000101001" + "1111111101010100011101001110111110100100001100001101100011000010100011010011101111000111111101000101001" + }, + /* 74*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "BP2D+1.00+0005+FLE ESC BV+1.00+3.60*BX2D+1.00+0001+Casual shoes & apparel+90044030118100801265*D_2D+1.02+31351440315981+C910332+02032018+KXXXX CXXXX+UNIT 4 HXXXXXXXX BUSINESS PARK++ST ALBANS+ST ALBANS++AL2 3TA+0001+000001+001+00000000+00++N+N+N+0000++++++N+++N*DS2D+1.01+0001+0001+90044030118100801265+++++07852389322++E*F_2D+1.00+0005*", 0, 26, 222, 0, "MR #151 NUM -> BYTE Ex. 1; BWIPP different encodation", + "111111110101010001101010000110000011001001000011000111010010000111001000011011100011010000010011101110100000100010010001101001000001100011101010111000000100001010000010001110101011100000011010100001100000111111101000101001" + "111111110101010001111010110110000011101000011001000111000011001110101001001111100110011101111011111010100010011110000101110000100001101011001100001111010100010001111001001111100110110011011110101000010000111111101000101001" + "111111110101010001010100001111000011111101011000010111010001111100101011010000001110011011111010001000111010010011111101000011100001011010001111000110110110111111000110101101011111100010011010110111111000111111101000101001" + "111111110101010001101001001100000011101010111000000100001010000010001110101011100000011101001101111000100001101110001101000001010000010011011100011001000101010000001000001100111000011010011010010011000000111111101000101001" + "111111110101010001111010111101111011111001011011100111010001100000101100000101110100011001001111000110110000010111001001111100010110111011110101100110000111101000110110001101111101011110011010111000001000111111101000101001" + "111111110101010001111010111110110010000111100010100111011101001111001011110110000110010110111101111110100110110000111101001111100001101010000110010111000110000011010111101100011111001001011010111111010000111111101000101001" + "111111110101010001101001111011111011001111011100100110100001100011101101100100010000011010001100111000101000011000110001100001010000011011011100110100000101000100001000001001111011110100011010011110111110111111101000101001" + "111111110101010001111101001000110010100000111101000101000011110100001111101101000100011001111101011110100010111101000001011111101011000011011111010111100111100001100110101100011101111101011111101001011100111111101000101001" + "111111110101010001111101001110100011111010111000010101000100001111001110100111110010010101001111000000110101001111100001010011011111000011110101111101100100001101001110001001101000111000011111010011100010111111101000101001" + "111111110101010001010001110001110011101111011010000111011110110010001010001000000100011101111011010000111011110110001001110000100101110010000101110011100110110011000011001000001010001000010100011100011100111111101000101001" + "111111110101010001101001111011000011010001110000100110000010001110101100001001110010011000010011100100110000100111001001100001001110010011100001000011010111110111001101001100101111000110011010011100001000111111101000101001" + "111111110101010001111110100011001011001010000111110101111001000010001011100000101100011011110100110000110111111000110101000011010011100011011110010110000110001111001011001111110101101000011111010001110010111111101000101001" + "111111110101010001101000001001100011010111101111100100110110001000001000001000100100010000010001010000110000101000110001000010000010100010010000010100000111010110111100001000100000100100011010000010011000111111101000101001" + "111111110101010001110100011001000010111001101111110111110001110110101110010001101000011101001100001000101001111100001101111001100110100011011111010111100111110101011000001111110101011100011110100010000100111111101000101001" + "111111110101010001010000001001111010011100001000110110101011111000001101010111110000011101001011111100110101011111000001110100101111110011010101111100000110101011111000001101010111110000011001010011111000111111101000101001" + "111111110101010001001011001100000011101010111000000100001010000010001010110000110000011100001001011100100010011001100001110000100101110010001001100110000111000010010111001000100110011000010010110011000000111111101000101001" + "111111110101010001111101000010110010011001111101000111110101011000001111010110001100010111001101111110101110011011111101110001000011010011011000111100010101110011011111101110001000011010011010001111101110111111101000101001" + "111111110101010001111001011110001010011000110011110100111101000010001011110010000010011101000101111110101000011001111101011110001100011010000100010111100111010010111111001101010111110000011001011111101000111111101000101001" + "111111110101010001101101000001000011110101011110000100001010000010001110101011100000011101001101111000100111101111010001110001010111000010001000011001100101101110110000001101100001100110011011010000010000111111101000101001" + "111111110101010001111010000011011011011111010011110101110011111100101101111010011111010111111010110000110111110101111001011100110111111010111001101111110111111010100011101100101110000001011110100000101000111111101000101001" + "111111110101010001101101100111110010100110011111000101100111001111101101000100011111011101001111100100100001101001110001111100101110100010011110100000100100001111010000101000011100001011010010010000011110111111101000101001" + "111111110101010001001001100001100010000010011101110100000100010010001101001000001100011101010111000000100001010000010001110101011100000010010111101111000100001100011001001000011000110010010010011000011000111111101000101001" + "111111110101010001111001011011000010111111010110000101111110101100001011111101011000010111111010110000111101110111001001111101011000111011100100001100010111010011000010001001111100101110011110010100001000111111101000101001" + "111111110101010001110010011111001011110010111100010101111011100111001010000100001111010010001101111100100100000101111001100111100010011011011111000100010101110010011000001001001011110000011011001011110000111111101000101001" + "111111110101010001101100110110000010110001111001110101011111011111001001001100110000011011000010000010110110001100110001110100100011100010011011000010000111011010000110001100010111011110011011001101100000111111101000101001" + "111111110101010001100101111000110010111011011111100110001011100000101110001011000010010011100010111110111001001110011001110001011001000011110101111011110101011111011000001100110011110100011100101111011100111111101000101001" + }, + /* 75*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "[)>\03601\0350246290\035840\03501\0355622748502010201\035FDE\035605421261\035280\035\0351/1\0350.30LB\035N\035201 West 103rd St\035Indianapolis\035IN\035Recipient Name\03606\03510ZED006\03511ZSam's Publishing\03512Z1234567890\03515Z118561\03520Z0.00\0340\03531Z1001891751060004629000562274850201\03532Z02\03534Z01\035KShipment PO10001\035\036\004", 0, 26, 222, 0, "MR #151 NUM -> BYTE Ex. 2; BWIPP different encodation", + "111111110101010001101010000110000011001001000011000100000100001000101001010000100000010000100011011000100010100000100001000100001110111010010001000000100101011110111100001000011000110010011010100001100000111111101000101001" + "111111110101010001111010110110000011111000111011010101011111100111001010000111100100010110100111111000101111110010001101111101011101111011001011100000100111110101110111101011111100100011011110101000010000111111101000101001" + "111111110101010001010100001111000010101110001111110111010101111110001001111110011101010101110001111110100001111000101001111110101110011011011100110011110100001001001111001010111000111111011010110111111000111111101000101001" + "111111110101010001101001001100000010111000111000010111101010111100001000001000010001010101111011110000101001111000111101101001111011111010100111100111100101011110111100001000011000110010011010010011000000111111101000101001" + "111111110101010001111010111101111011100011101111010111101010001000001111101000101100011110101110011100110100001111011001011111100100011011111010111011110111111010010111001111101011101111011010111000001000111111101000101001" + "111111110101010001111010111110110010000011110010100101001011110000001001111001100110011110100001111010111011000101111101000100100001111011000111110010010100111110011000101001110111011110011010111111010000111111101000101001" + "111111110101010001101001111011111011010111000111100100100000101000001111001111001010010101111011110000111001101110111101111001111001010010101111011110000100001101110001101111010101111000011010011110111110111111101000101001" + "111111110101010001111101001000110011000001011101000100001011110000101110100011000001011001100111100010111100000100010101111101010011000011100001101110010110100111110011101100000100111010011111101001011100111111101000101001" + "111111110101010001111101001110100010111100011001100100111111001110101010111000111111010011111011101100101110010110000001101100110011111010001000110111110100001011011111001001101100001111011111010011100010111111101000101001" + "111111110101010001010001110001110011000100000100110111100111100101001010111101111000010001110111000100111011001100111001111001111001010010101111011110000100110001100000101101000011101111010100011100011100111111101000101001" + "111111110101010001101001111011000011001011110000110110010111000001001110110001110010011100000101100010100100011111001101111011001110011010111111001000110110101110010000001111100011101101011010011100001000111111101000101001" + "111111110101010001111110100011001011111001001110010100111111001110101010111000111111011111010111000010100000011010011101101000001011111010011111001100010110101000111110001001111110011101011111010001110010111111101000101001" + "111111110101010001101000001001100010101111011110000101011110011110001000111011100100010011000011010000110101101110000001100001100011011011000100000101100110000010010110001100001010000011011010000010011000111111101000101001" + "111111110101010001110100011001000010010011111101110100110111111001101100101111000110011010000001110010101111110010001101111101011101111011110000010001010111010011000001001111000110001101011110100010000100111111101000101001" + "111111110101010001010000001001111011111010111101100101000100000111101111100101111011011100100111110010101100011001111001001111110011101010101110001111110111101011110001001000000110100111011001010011111000111111101000101001" + "111111110101010001001011001100000010000010011000110110100100110000001110010110111100011010011000011100111100111100101001010111101111000010100111011100000100011101110010001000011011100110010010110011000000111111101000101001" + "111111110101010001111101000010110011111001101100110111110101110111101011111100100011011110101110111000111110101110111101011111100100011011111010111011110111010011101100001001111001011110011010001111101110111111101000101001" + "111111110101010001111001011110001010000111100010100111101011110001001110100100111111011110100011110010100111000110011101101001111110010010000010100011110101111100110100001110111101011100011001011111101000111111101000101001" + "111111110101010001101101000001000010001110111100110100000100010001001010100000010000010110001100100000100000100001000101010111101111000010000110001100100100000100111011101101000110011100011011010000010000111111101000101001" + "111111110101010001111010000011011011110001100011010111101010010000001011111100100011011111010111011110111010011100110001001111001011110011111000111011010101011111000110001011111100100011011110100000101000111111101000101001" + "111111110101010001101101100111110010101110001111110110011111000100101101111001000011011100100111110010100001010001111001100101001111100011001110000101110100000111010011001000010110111110010010010000011110111111101000101001" + "111111110101010001001001100001100010000010011000110111010101110000001111010101111000010000010000100010101011110111100001101011110111110011110101001111000100001100011001001000011000110010010010011000011000111111101000101001" + "111111110101010001111001011011000010111111010110000101111110101100001011111101011000010111111010110000101000011110010001011001111100001010011100101111100111011101111010001101011111000111011110010100001000111111101000101001" + "111111110101010001110010011111001011001111101101100110001101001111001110001010111111011000001010111110101100011011110001101110100111000010101000001111000111001111110101001000110011011110011011001011110000111111101000101001" + "111111110101010001101100110110000010011000011101100100111101111010001100011011001100011110111101001000111100110100111001101000010011000011100110010110000100100110000110001100001000001011011011001101100000111111101000101001" + "111111110101010001100101111000110011101000011000010100110111111011001111100011001010010100111110001100100111011011111101111110010100111011111011000010010111101011011000001110101111101111011100101111011100111111101000101001" + }, + /* 76*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "[)>\03601\0350274310\035250\03570\0351111123177100430\035FDE\035630133769\035222\035\0351/1\035160.00KG\035N\03554 Some Paris St\035Paris\035 \035F. Consignee\03606\03510ZEIO05\03511ZThe French Company\03512Z9876543210\03514Z5th Floor - Receiving\03515Z113167\03531Z1010147571640963660600111112317710\03532Z02\035KMISC_REF1\03599ZEI0005\034US\034200\034USD\034Content DESCRIPTION\034\034Y\034NO EEI 30.37 (a)\0340\034\035\036\004", 0, 28, 239, 0, "MR #151 Ex. 3; BWIPP different encodation", + "11111111010101000101010000010000001101100110110000010000010000100010100101000010000001000010001101100010001010000010000100010000111011101001000100000010010101111011110000100001100011001001000011011100110010101000001000000111111101000101001" + "11111111010101000111101010000001001111101001011000011111101000101110110101110010000001011111100100011011111010111011110101011111100011101111101011101111010111111001000110111110101110111101111001010100000011111010100001100111111101000101001" + "11111111010101000110101000011111001001111110011101010101110001111110100001111000101001010110001111100010111110011000010111111010001101001110111101001110010100011000111110100110000101110001100111111011001010101101111100000111111101000101001" + "11111111010101000111010010011100001010111101111000010100111100011110110100111101111101010011110011110010101111011110000100001100011001001110001110100100010100011000110000101011111011111001101000111001111011101001001110000111111101000101001" + "11111111010101000111010111101110001111101000001011010111111001000110111110101110111101010111111011100011101001100000010100111111010001101101011110001100011100001001110110101001111110011101001011111001100011101011100000110111111101000101001" + "11111111010101000111010111110010001000100100001111011000111110010010101111110111000101011010000001110010000100010111100111110101110001001000101100111110010011111100111010101011100011111101001100011001111011101011111000010111111101000101001" + "11111111010101000101001111001111001111001111001010010101111011110000111000111010100001100101001100000010000010001010000100000100101000001000101000010000011000001010011000111101110110111001101110011000010010100111100111100111111101000101001" + "11111111010101000111101001000100001011101100111111011000001001110100110001000111101101011111100100011011111010111011110111000011011101001111010110011000011001011111011100101111110010001101111101011101111011110100100100000111111101000101001" + "11111111010101000111111010011101101100011110010110010011111100111010101011100011111101000011100010110010111111001110010110011111011011001101000101111100010011000010011100101111011101110001001001000001111010100111001111110111111101000101001" + "11111111010101000101000111101111001010000010100000011110011110010100110101111011111001000011011100110011100100110111100111100111100101001010111101111000011010111101111100100011101110010001101000001001100010100011110111100111111101000101001" + "11111111010101000101001111010000001111001000000101011110101000100000101111110010001101111101011101111011101011100110000100111100101111001101110111110001011111001010011000111000001011000101111010000100001011101001110000110111111101000101001" + "11111111010101000101000110011111001100101001111100010100110000111110100111110110100001111010011110100010111011000111000110101101111110001001111000010010010011111100111010101011100011111101011111101110001010100011101111110111111101000101001" + "11111111010101000111010000010011101101000110011100011001110001100010101100111100111001110110111001111010010100000100000101000110000110001101011110111110011110011110010100101011110111100001111101011111101011101000001001110111111101000101001" + "11111111010101000111110100011011101001111001011110011100001100111010110000110111101001111001011101110010000010111100010101100100111111001110010000011001011000001011101000111100110110100001000111001011111011110100010000010111111101000101001" + "11111111010101000100101011110000001001111101100001011010011001111110110110001001111001111011001111101011111001001110010100111111001110101010111000111111010111111011100010101101000001110001000001100100111010010100111100000111111101000101001" + "11111111010101000110010110011100001010111100111100011010001100011100111101101000011101111001111001010010101111011110000110100011000111001000111011100100010011110111101000111010010111000001111010001001111011001011001110000111111101000101001" + "11111111010101000111101000010100001100001001110001010010011110000100100100001111010001110100011100011010001001111000010111110111101110101001101111110110011001011110000110100111101011110001111010100000100010100011111001100111111101000101001" + "11111111010101000111001011111010001100111111011001010101110001111110110001111100100101000111100011011011101000101111110100000110010011101010100111100000010011111100111010101011100011111101100111110001001011100101111100010111111101000101001" + "11111111010101000111011010000011001000101101100000010111001111011000111100111101001001110111001100110011111011010111100110100110000111001111001111001010010101111011110000100100011100011101000111011100100011101101000001100111111101000101001" + "11111111010101000111010000011010001111010001000010011111000111011010111110101011000001101000011100001010111111001000110111101011101110001101111101011110011111000100010110101111110010001101111010111011100011111010000010110111111101000101001" + "11111111010101000110010010001111101000011100001011011010101111100000100111111001110101111101011100010011011111100011010101111011000001101001111110011101011111010111000100110100010111110001001100001001110010110110000111100111111101000101001" + "11111111010101000101101110000110001101110001110011011001101100011000100000101000100001000001001110111010100000010100000101000100010000001011001100010000010111000111000010100110111110111101000001000010001010110111000011000111111101000101001" + "11111111010101000111001011010000001111010111011100011110101110111000111010011000000101111010111011100010111111010110000111101100011000101110111101111101011110100010000100110000010111010001101001110100000011111001010000110111111101000101001" + "11111111010101000111011011111100101001110111011110010110011011110000100000111000101101001111101100100010000111100110110100111111001110101111101011100010010011111001100010110011111101100101111101011100010010110010111000000111111101000101001" + "11111111010101000110010001001100001010111101111000011010111101111100111101010011110001000011000110010010000110001100100100001100011001001000011000110010010000110001100100110111011001000001100001000101100011001000100110000111111101000101001" + "11111111010101000100101111000100001101100111100001010001011111011000110101111101110001110100011001000011110111001110100110010111000010001101110111110010010011111101101110110111100101111101011001111110110010010111100100000111111101000101001" + "11111111010101000101100111001111101110010111110100010110001001110000101110000100011001001110000001011010111100001000100100111000100001101000010011011111010000011101101110110011001011110001111010111100100011110010001111010111111101000101001" + "11111111010101000100100011100011101001000110011000011010001000110000111001011011110001000101110001110011001000100110000101100011101100001110001000100111011100100011011110110110001000100001010000001000001010010001110001110111111101000101001" + }, + /* 77*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "[)>\03601\0350278759\035840\03503\0355659756807730201\035FDE\035604081602\035169\035\0351/1\0355.00LB\035N\0351234\035Austin\035TX\035Test Co\03606\03510ZED007\03511ZTest Co\03512Z8005553333\03515Z119534\03520Z0.00\034134\03531Z1001901752720007875900565975680773\03532Z02\03534Z01\03539ZNOHA\035\03609\035FDX\035z\0358\035-]\021\020<2\177B\036\004", 0, 25, 222, 0, "MR #151 Ex. 4; BWIPP different encodation", + "111111110101010001101010000110000011011011011000000100000100001000101001010000100000010000100011011000100010100000100001000100001110111010010001000000100101011110111100001000011000110010011010100001100000111111101000101001" + "111111110101010001111010100000010011111000111011010111110100101100001100101111011000010100011111001100101111110010001101111101011101111011001011100000100111110101110111101011111100100011011110101000010000111111101000101001" + "111111110101010001010100001111000010101110001111110110101001111100001001111110011101010101110001111110100001111000101001111110101110011011110000101111010111011111100100101000111101100011010101101111100000111111101000101001" + "111111110101010001101001001100000010000110011000100100011000001101001000001000010001010101111011110000101001111000111101101001111011111010100111100111100101011110111100001000011000110010011010010011000000111111101000101001" + "111111110101010001110101111011100011100011101111010111111010100111001111010100001000011010111000010000111101010010000001011111100100011011111010111011110110101110000100001110110111000100011010111000001000111111101000101001" + "111111110101010001111010111110110010000011110010100101001011110000001001111001100110011110100001111010111011000101111101000100100001111011000111110010010101111110111101101000010001011110011101011111000010111111101000101001" + "111111110101010001101001111011111011010111000111100100100000101000001111001111001010010101111011110000111001101110111101111001111001010010101111011110000100000100110001101010011100111000011010011110111110111111101000101001" + "111111110101010001111010010001000011010001111011000101111110010001101111101011101111011111000111011010110000010011100101001100101111110011001011110001100101111110010001101111101011101111011111101001011100111111101000101001" + "111111110101010001111101001110100010000011101001100101111000100001001001111110011101010101110001111110101111000110110001100101000011111011001110000101110100111110110001001011100001100111010100111001111110111111101000101001" + "111111110101010001010001110001110011110011110010100110101111011111001000011011100110011100100110111100111100111100101001010111101111000011010111101111100100011101110010001010000111000111010100011100011100111111101000101001" + "111111110101010001010011110100000011111000111011010111111010100011101011111100100011011111010111011110111010111001100001001111001011110011011101111100010111010001100000101100110011110001011010011100001000111111101000101001" + "111111110101010001111110100011001010011111011000100101110000110011101001111110011101010101110001111110101111110111000101110100010111111010000011001001110110110011001111101010100011110000010100011101111110111111101000101001" + "111111110101010001101000001001100011001011011100000101000110000011001010001100000110011110011110010100101011110111100001110100101110000010001110111001000100000100110001101110100100111000011010000010011000111111101000101001" + "111111110101010001111101000110111010100011110001000110100011110110001011111100100011011111010111011110110101111100011101001111001011110011111000111011010111110011011001101111101011101111011110100010000100111111101000101001" + "111111110101010001010000001001111010011111100111010111110101110001001111010111100100011111001011101000100111111001110101010111000111111010100010001111000100000011010011101000011110001010010010100111100000111111101000101001" + "111111110101010001001011001100000011101001011100000110100110011100001101000001000110010001001100110000111001100110011101111100101011111011100100000101110110000100110111001110111101100010010010110011000000111111101000101001" + "111111110101010001111010000101000011011011110001000111101000010000101110001011101100011011111101011100111110101110111101011111101011000011110001110111010111010011000001001111000110001101011010001111101110111111101000101001" + "111111110101010001111001011110001010101001111000000100111111001110101010111000111111010100010000011110100000011010011101001111100110001011111101001101000100111111001110101010111000111111011100101111100010111111101000101001" + "111111110101010001101101000001000010100011110111100100011101110010001001101100100000010110111011000000100000100001000101010010000001000011110111101100110111110101011111001101111011101000011011010000010000111111101000101001" + "111111110101010001110100000110100011110010000101000110100111110111001100010111000010011100000101101000111110100010011001100100000011101011010111100011000111000001011001001100100011101000011110100000101000111111101000101001" + "111111110101010001101101100111110011111101001101000111010011111001001110100101111110010100000010111100101001100011111001111101011100001011101010011111100110001111100100101100011111001001010110110000111100111111101000101001" + "111111110101010001001001100001100010000110001100100100001100011001001000011000110010010000110001100100110000110110110001110011101001000010111000111000010101000111001110001001101100001000010010011000011000111111101000101001" + "111111110101010001110010110100000011000100011100100111100100010010001011111101011000011000100111100110101001111101100001111101000100011011001100111100010111000100111011001110001001101000011110010100001000111111101000101001" + "111111110101010001110010011111001010111111001110100101111100001100101100111101001100011011111011001100101111001000100001011110010000001011011000010011110111011111101001001111001011110010010110010111000000111111101000101001" + "111111110101010001101100110110000010110011100110000110011101100100001110001110100010010001001110001110100100000100001001101000001000110011010000100011000111010000100111001000110110010000011011001101100000111111101000101001" + }, + /* 78*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "[)>\03601\0350285040\035840\03501\035D10011060813097\035EMSY\03537\03562\035\0351/1\0353LB\035N\0354440 E ELWOOD ST\035PHOENIX\035AZ\035CXXXXXX RXXX\03606\0353Z01\03511ZONTRAC - CXXXXXX RXXX\03512Z\03514ZSTE 102\03515Z90210\03520Z2000\034U\0341288\03521Z1\03522Z0\03524Z1\0359KRef-12549\035\036\004", 0, 25, 205, 0, "MR #151 Ex. 5; BWIPP different encodation", + "1111111101010100011010100001100000100101110011100001000001000010001010010100001000000100001000110110001000101000001000010001000011101110100100010000001001010111101111000011101010001110000111111101000101001" + "1111111101010100011110101000000100101111110101100001111100011101101011111101001011100111010001111011101010011111100111010111111001000110111110101110111101100101110000010011110101000010000111111101000101001" + "1111111101010100011101010001111110101011100011111101001111110011101010101110001111110111010101111110001001111110011101010101110001111110100011110001101101000011110001010010101101111100000111111101000101001" + "1111111101010100011010010011000000111001011101111101100001011001110011000110001001000100010011011000001001100111100111010000010000100010110100110111000001101001000001100011111010010111110111111101000101001" + "1111111101010100011101011110111000111101100011010001111011011000100011100100011001000111101001100011001110001100111010011100101111011100111000101110011001000101111100011011010111000001000111111101000101001" + "1111111101010100011101011111010000101001011110000001100111110010010011011111101101000100111001001100001100010100011111011110100111100100101001100011111001010111000111111011101011111000010111111101000101001" + "1111111101010100011010011110111110110100010001100001010111101111000010000110001100100100001101111011101010000010100000011101011100111110100001101111011101001110001110100010100111101111000111111101000101001" + "1111111101010100011110100100010000111110010001001101111011000011001011010011111001110100110010111111001011111100100011011111010111011110111100010100100001001000011110001011111101001011100111111101000101001" + "1111111101010100010100110000111110111011100100111101011111011110111010011111100111010101011100011111101111101011100100010011111100111010101011100011111101110100111111011010100111001111110111111101000101001" + "1111111101010100010100011100011100111011110110100001110111101101000011101111011001000100010000100001001110111101101000011110011110010100110101111011111001000011011100110011010001110011110111111101000101001" + "1111111101010100010100111101000000110100000011100101011111100100011011111010111011110101001111100001101111000110001101011111101010111000101111110010001101111101011101111011010011100001000111111101000101001" + "1111111101010100011010001101111110111101011110100001000000110100111010011000010011100110111100010110001010100111100000011001111101101100100011001000111001000011100001011010100011101111110111111101000101001" + "1111111101010100011010000010011000111011110110100001110111101101000011101111011010000111011110001100101110111101101000011100111001000010111100111100101001010111101111000010100000100100000111111101000101001" + "1111111101010100011111010001101110111100000100010101110100110000010011110011100111010101111110010001101111101011101111011110000010001010101000111101000001111110011100101011110100010000100111111101000101001" + "1111111101010100010100000010111100110011100010011101100111110110110011111010111000010101000100111100001001111110011101010101110001111110111101011110001001000000110100111010010100111100000111111101000101001" + "1111111101010100010010110011000000110000110010100001111101010111110011010111101111100111100111100101001010111101111000010100111011100000100011101110010001000011011100011011110010110111110111111101000101001" + "1111111101010100011110100001010000111110101011000001111101011101111010111111001000110111101011101110001101111101011110010111111001000110111101011101110001111000001000101011010001111101110111111101000101001" + "1111111101010100011110010111100100111110100111010001001000010011110010011111100111010101011100011111101101001101111110010000001101001110101111110111000101001111110011101011100101111100010111111101000101001" + "1111111101010100011011010000010000101011110111100001110100111011111010001110111001000100001101110011001111001111001010010101111011110000110100111001111001000111011100100011110110100001110111111101000101001" + "1111111101010100011101000001101000111100000100010101011111100100011011111010111011110111100100110001101101101111000001010000010111100100110100001110001001000101111010000011110100000101000111111101000101001" + "1111111101010100010110110011110000111111010011000101001010111100000011001111110110010101011100011111101111101011100001011101010011111100110001111100100101100011111001001010110110000111100111111101000101001" + "1111111101010100010010011000011000110101110011110001111101111101001011110011110100100100010000100001001001011000001100010010001000100000110011011011000001111001000101111010110111000110000111111101000101001" + "1111111101010100011100101101000000101111101101111001110100000011010011110100100100000110000101110010001011110000101111011111001100101000101110100111110001000100000111101011110010100001000111111101000101001" + "1111111101010100011101101111110100111111000101101001110011110010111011011111101100010101111100110000101011110100000010011111101000011010110110010011110001111110100011001010110010111000000111111101000101001" + "1111111101010100011011001101100000111011000010011001101001000011000010000101100000110110100010110000001101110111100111011100011101100110111011101100110001110010111011111011110010001011110111111101000101001" + }, + /* 79*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "01\01130\011{)>\01194\011GSA/XE 7\0110200\01502\01107072017\0111Z291YX2AT50000027\01111\011P\011\0113\01110.0\011KGS\011\011\011F/D\011415.52\011USD\011\011\011\011US\011EFTA\011U\011\011\011\011\0112\01504\011SH\011PHILIPS HEALTHCARE\011ROERMOND\011\0116045GH \011NL\011291YX2\011MARIE CURIEWEG 20\011\011\011NL009076840B01\011PHS EMEA TOMS\011310475528727\011\011\011\01504\011ST\011PHILIPS MEDICAL SYSTEMS\011LOUISVILLE\011KY\01140219 \011US\011\0111920 OUTER LOOP DRIVE\011\011\011\011C/O UPS-SPS. DOCK 157\011\011\011\011\01505\011GSI\011MEDICAL EQUIPMENT\01507\0111Z291YX2AT50000027\01110.0\011\011\011\011\011\011\011\011\011\011\011\01508\0112\011EA\011103.88\011FILTER 603Y0066\011JP\011\011\011\011\011\011451213341491\01508\0112\011EA\011103.88\011FILTER 603Y0066\011JP\011\011\011\011\011\011451213341491\01513\011\011\011\0114509123000\0112\011415.52\011415.52\01599\015", 0, 32, 256, 0, "MR #151 Ex. 6; BWIPP different encodation", + "1111111101010100011010100000110000101100011110111001000011011100110011101001000111000101000110001100001110011010110000010111100011110010111010001011100001100001100011011010010001110111000110011010010000001110110110011100011010100000110000111111101000101001" + "1111111101010100011110101101100000111110101110111101100110011110010011010001110000100110000010001110101110110011101000011010111110001110111110101000001101111010100100000011101100111010000111100101010000001111110010101110011110101000001000111111101000101001" + "1111111101010100010101000001111000111010101111110001011001011100000010100100000111100100000110010011101111110100111011010100100000111100111011111000101101000011100001011010011111001100010100111000010011001111110010111011011010110111111000111111101000101001" + "1111111101010100011110100100111100111010101110000001110101011100000010100111101111000100010100010000001110100100011100011000111011000100111000011001001101110001010001110010001010001000000111101011001111101101011011100000011110100100111100111111101000101001" + "1111111101010100011110101111011110100000100011110101101000001110010010001110111111010111001000111001101110000110011101010000001001111010101001111100001101111011001110011011110101110001110111100010011011001111010010001000011010111000000100111111101000101001" + "1111111101010100011110101111100110110111111000110101011110110000011010001111000010100101110110011100001001100110001111010111100000100010110001111101010001010000010001111010011100010110000110001111101010001000011010011100011010111111010000111111101000101001" + "1111111101010100010100111100011110110001011001110001100010110011100011000101000110000110110000100000101010000010000100010000010001010000111011001000110001100010110001110010010011000011000110110000110011001011101110100000010100111100011110111111101000101001" + "1111111101010100011111010010001100110011100111110101010011111100111011111001000101100111111001010111001111010110011000011010001111011000110110011110000101001000011110001011100010011000010111100100000100101010011111000011011111010010011000111111101000101001" + "1111111101010100010100111011111100101110110011100001011010000001110010100000100011110111011111100101001011001101111000011000111100101100110001111101010001011100100001100010001111000010100111111010011101101010010000011110011111010011100010111111101000101001" + "1111111101010100011010000101100000101111011110100001000011011100011011001101001000000111000101001110001101110011000010011001010011000000101000100001000001101110011000010010100000010000010111010000010111001000001010001000011010000101100000111111101000101001" + "1111111101010100011010011110110000110101111100011101110010001110011010010001111101100111110110001101101111100011101101011111010100001100111111010100011101111010000010100010100111111001110111100000100010101111100011101101011010011100000100111111101000101001" + "1111111101010100010100011000111110111010111110000101011111100111010010110010001110000110001111010011001101110100000111011111101011100110100111000110011101001100100000111010001111000010100101000100011110001110101001111110011111010001110010111111101000101001" + "1111111101010100010100000100010000110110111001110001001010000100000011110010001011110101001111011110001100010110011100010001011001100000111101010011110001100110100100000011100110000100110111001111011001001110011001000011010100000100010000111111101000101001" + "1111111101010100011101000110010000111001011110011101100101111000011010111011001111110111101100111001101101001110000100011010111110001110111100100010000101111101110110010010011001011111100111110100011011101111100010001011011101000110100000111111101000101001" + "1111111101010100011001010111110000110011001001111001011100001011000011011000101111000111000111010111101111110011011101011111001011101000100110010011100001011111000110100011011101000001110101010011110000001110101111100100011001010011111000111111101000101001" + "1111111101010100011100101100111100100000101001000001000001010010000011001101001000000111100011010111001110000110010011010001010001000000100100011000011001110101110011111011100011101100110110001101001000001010000011000110011100101100111100111111101000101001" + "1111111101010100011111010000101100100111001111110101111011000011001011100010111001100111001110011110101111000100110011011000100001110100100011101111110101110010001110011010010001111101100111010011000000101110001000110001010100011111000110111111101000101001" + "1111111101010100011110010111110110111001111101011001110000101111101010000111100101000100011000110111101011110010000010010111101100110000100011110001101101101110001011100011001101000011110101111110111000101111001011110010011001011111101000111111101000101001" + "1111111101010100011001001011000000110001011001110001100010110011100011011000010000010110010110001110001110001110100100010111001111101110111001111011001001000101000010000010100011100011100101001110111000001100010101100000011001001011000000111111101000101001" + "1111111101010100011110100000110110111101000110001101000100011111011011110001010000010111010001100100001000100011110100010010011110000010111001011010000001101011111001110011110001100011010111101001001000001101011111001110011110100000100100111111101000101001" + "1111111101010100010110110001111000111011111000101101000011100001011010011111001100010100111000010011001111110010111011011010101111100000110101011111000001010011000011111010111010000110000111111010110001001010110111110000010010010000011110111111101000101001" + "1111111101010100010010011101110000110001011001110001100010110011100011000101100111000110001011001110001100010110011100011011000010000010100100010001000001110100010111000010000110111101110110101110001111001000101000100000010010011101110000111111101000101001" + "1111111101010100011110010110110000111110101001100001111000100110011010010111100010000111000011001110101110010111100111011110001000100010100110111110100001100000101110100010100001111010000101001111100001101110001100111001011110010100000100111111101000101001" + "1111111101010100011001001111110100110101011111000001100100100111110010011001100011110101100000101110001000111100001010010111011001110000101110110011100001101110100000111010010111011111100110100110111111001010001000011110011011001011110000111111101000101001" + "1111111101010100011100100010011100101000011000001101110100000100111011010010001100000110101000011000001100010100011000011001101001000000101000011000011001110000110010011011010111101111100110100001000110001101100110110000011100100010011100111111101000101001" + "1111111101010100011001011110001100100100011111011001101000111110111011111001000101100111010001100001001110000010110010011100011101111010111110101001100001011111010000111011111000111011010111110101000110001110100000110100011001011110011000111111101000101001" + "1111111101010100011111001000111010110111111001101001000110100000111010111011001110000101110110011100001011101100111000010100000100011110111110101111011001111010111100100010100010000011110111110101111001101001000010001111011110110011111010111111101000101001" + "1111111101010100010110011110001110100100000101000001111010000101111011000101100111000100010100001000001110010100011100010110011100011000101001110011100001110101011100000011010110111000000111010001011100001010000110000011010110011110001110111111101000101001" + "1111111101010100011111011011001100111101000010000101101000111100110011110110011100110111101011100011101111000100110110011111101001001110111101101101000001111001000110110010111111010110000101111110101100001011111101011000011110010010010000111111101000101001" + "1111111101010100010110000100001110110001111100100101001111011000011010000010100111100101111000010100001001111110111001011011110100011000111110101110010001110000101111101011001111101000010100100111011111101001111100001101010010000010011110111111101000101001" + "1111111101010100010010000110110000100100001101100001010000001010000011011001000100000101001110111000001000101000100000011001011011100000110101110111100001000001010000010010000010011101110110011110111010001110111101110011010010000110110000111111101000101001" + "1111111101010100011011011110001000100100001111001001111000100001010011111100110101100101011111100011101000001011110010011101000011000010101110011111101001011101111110001011100110001110010100110101111110001111110100010111011011011110010000111111101000101001" + }, + /* 80*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABC123456789ABC", 0, 9, 103, 1, "T3 N9 T3 -> T15", + "1111111101010100011111010101111100110101000001100001111010101111000011110101011110000111111101000101001" + "1111111101010100011110101000010000111010011000001001111010111001110011110101001000000111111101000101001" + "1111111101010100011101010111111000101000100000111101111100101111011010101000011110000111111101000101001" + "1111111101010100011010111100111110100100110000110001001000010010000010101111001111000111111101000101001" + "1111111101010100011010111000001000111111010101110001110100110000001011110101110011100111111101000101001" + "1111111101010100011110101111010000100111101001000001110110001011111011110101111101100111111101000101001" + "1111111101010100011101001110111110110111000110010001100110001001000011010011101111000111111101000101001" + "1111111101010100011111101001011100100100111110110001110110000111010010101111110111000111111101000101001" + "1111111101010100011010011011111100101111100110010001011110010100000011111010011101000111111101000101001" + }, + /* 81*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABC1234567890ABC", 0, 9, 103, 1, "T3 N10 T3 -> T16", + "1111111101010100011111010101111100110101000001100001111010101111000011110101011110000111111101000101001" + "1111111101010100011110101000010000111010011000001001111010111001110011110101001000000111111101000101001" + "1111111101010100011101010111111000101000100000111101111100101111011010101000011110000111111101000101001" + "1111111101010100011010111100111110100100110000110001100100011000111010101111001111000111111101000101001" + "1111111101010100011010111000001000111110001110110101111010111001110011110101110011100111111101000101001" + "1111111101010100011110101111010000111011111101000101010011100111111011110101111101100111111101000101001" + "1111111101010100011101001110111110100001011011000001001000001101100011010011101111000111111101000101001" + "1111111101010100011111101001011100110100011111011101110000010111011010101111110111000111111101000101001" + "1111111101010100011010011011111100110001001111110101000111100001001011111010011101000111111101000101001" + }, + /* 82*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABC12345678901ABC", 0, 10, 103, 0, "T3 N11 T3; BWIPP -> T17", + "1111111101010100011101010011100000110101101110000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111010100011000111010011000000101011111101001100011111010100110000111111101000101001" + "1111111101010100011101010111111000111110010111000101111110100011001011010100011111000111111101000101001" + "1111111101010100010101111101111100110010000010110001110100001011100010101111001111000111111101000101001" + "1111111101010100011010111000010000101111110101100001111110101011100011010111000100000111111101000101001" + "1111111101010100011110101111010000101000100111100001100011111001001011110101111000010111111101000101001" + "1111111101010100010100111001110000101000011000001101000100111011100011010011101111000111111101000101001" + "1111111101010100011110100101000000100110111110100001111100011010100011010111111011110111111101000101001" + "1111111101010100011010011011111100100111000101100001100110100111100010100110001111100111111101000101001" + "1111111101010100010100011000001100110111011000100001000110001100001011010001100011100111111101000101001" + }, + /* 83*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "AB+12345678901ABC", 0, 10, 103, 0, "T3 N11 T3; BWIPP -> T17", + "1111111101010100011101010011100000110101101110000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111010100011000110111110101111001011111101001100011111010100110000111111101000101001" + "1111111101010100011101010111111000111110010111000101111110100011001011010100011111000111111101000101001" + "1111111101010100010101111101111100110010000010110001110100001011100010101111001111000111111101000101001" + "1111111101010100011010111000010000101111110101100001111110101011100011010111000100000111111101000101001" + "1111111101010100011110101111010000101000100111100001100011111001001011110101111000010111111101000101001" + "1111111101010100010100111001110000110001000010001101111010100111100011010011101111000111111101000101001" + "1111111101010100011110100101000000111101101101000001110001000011010011010111111011110111111101000101001" + "1111111101010100011010011011111100101000010001111001101111000101100010100110001111100111111101000101001" + "1111111101010100010100011000001100101100011100001101101100100010000011010001100011100111111101000101001" + }, + /* 84*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABC12345678901+BC", 0, 10, 103, 1, "T3 N11 T3 -> T17", + "1111111101010100011101010011100000110101101110000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111010100011000111010011000001001111010111001110011111010100110000111111101000101001" + "1111111101010100011101010111111000101000100000111101111100101111011011010100011111000111111101000101001" + "1111111101010100010101111101111100100100110000110001100100011000111010101111001111000111111101000101001" + "1111111101010100011010111000010000101011110000100001111000001000101011010111000100000111111101000101001" + "1111111101010100011110101111010000101000100111100001100011111001001011110101111000010111111101000101001" + "1111111101010100010100111001110000111000011010001101000110011010000011010011101111000111111101000101001" + "1111111101010100011110100101000000100110101111110001100000010111010011010111111011110111111101000101001" + "1111111101010100011010011011111100111110101110001001011110001010000010100110001111100111111101000101001" + "1111111101010100010100011000001100110001011000111001101011000111000011010001100011100111111101000101001" + }, + /* 85*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "AB+12345678901+BC", 0, 10, 103, 1, "T3 N11 T3 -> T17", + "1111111101010100011101010011100000110101101110000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111010100011000110111110101111001111010111001110011111010100110000111111101000101001" + "1111111101010100011101010111111000101000100000111101111100101111011011010100011111000111111101000101001" + "1111111101010100010101111101111100100100110000110001100100011000111010101111001111000111111101000101001" + "1111111101010100011010111000010000101011110000100001111000001000101011010111000100000111111101000101001" + "1111111101010100011110101111010000101000100111100001100011111001001011110101111000010111111101000101001" + "1111111101010100010100111001110000110011000010000101010010000001000011010011101111000111111101000101001" + "1111111101010100011110100101000000101111101011100001000100001111001011010111111011110111111101000101001" + "1111111101010100011010011011111100100001100101110001000000100101111010100110001111100111111101000101001" + "1111111101010100010100011000001100111000110001011001001000010000100011010001100011100111111101000101001" + }, + /* 86*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABC123456789012ABC", 0, 10, 103, 1, "T3 N12 T3 -> T18", + "1111111101010100011101010011100000110101101110000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111010100011000111010011000001001111010111001110011111010100110000111111101000101001" + "1111111101010100011101010111111000101000100000111101111100101111011011010100011111000111111101000101001" + "1111111101010100010101111101111100100100110000110001100100011000111010101111001111000111111101000101001" + "1111111101010100011010111000010000111101011100111001111100011101101011010111000100000111111101000101001" + "1111111101010100011110101111010000111110101111011001100011111001001011110101111000010111111101000101001" + "1111111101010100010100111001110000110100001001100001011000011100110011010011101111000111111101000101001" + "1111111101010100011110100101000000110000011011110101000100011111011011010111111011110111111101000101001" + "1111111101010100011010011011111100110011101000111001100011110001011010100110001111100111111101000101001" + "1111111101010100010100011000001100101000110110000001001001111001111011010001100011100111111101000101001" + }, + /* 87*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCD123456789ABC", 0, 9, 103, 1, "T4 N9 T3 -> T16", + "1111111101010100011111010101111100110101000001100001111010101111000011110101011110000111111101000101001" + "1111111101010100011110101000010000110101111110111101111000001000101011110101001000000111111101000101001" + "1111111101010100011101010111111000101001100111110001010000010001111010101000011110000111111101000101001" + "1111111101010100011010111100111110111101101000011101100100010011000010101111001111000111111101000101001" + "1111111101010100011010111000001000111110001110110101111010111001110011110101110011100111111101000101001" + "1111111101010100011110101111010000110011111010010001110100111110001011110101111101100111111101000101001" + "1111111101010100011101001110111110101110011100010001110010100011100011010011101111000111111101000101001" + "1111111101010100011111101001011100100010000111100101111001001100011010101111110111000111111101000101001" + "1111111101010100011010011011111100100100010111100001001001100011111011111010011101000111111101000101001" + }, + /* 88*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCD1234567890ABC", 0, 10, 103, 1, "T4 N10 T3 -> T17", + "1111111101010100011101010011100000110101101110000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111010100011000110101111110111101111000001000101011111010100110000111111101000101001" + "1111111101010100011101010111111000101001100111110001010000010001111011010100011111000111111101000101001" + "1111111101010100010101111101111100111101101000011101100100010011000010101111001111000111111101000101001" + "1111111101010100011010111000010000111101011101110001111110101011100011010111000100000111111101000101001" + "1111111101010100011110101111010000101000100111100001100011111001001011110101111000010111111101000101001" + "1111111101010100010100111001110000101100001101000001100100000010110011010011101111000111111101000101001" + "1111111101010100011110100101000000100000100111100101011011111010000011010111111011110111111101000101001" + "1111111101010100011010011011111100100001111000100101110111010011110010100110001111100111111101000101001" + "1111111101010100010100011000001100110010110111000001011001111011100011010001100011100111111101000101001" + }, + /* 89*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCD12345678901ABC", 0, 10, 103, 0, "T4 N11 T3; BWIPP -> T18", + "1111111101010100011101010011100000110101101110000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111010100011000110101111110111101011111101001100011111010100110000111111101000101001" + "1111111101010100011101010111111000111110010111000101111110100011001011010100011111000111111101000101001" + "1111111101010100010101111101111100110010000010110001110100001011100010101111001111000111111101000101001" + "1111111101010100011010111000010000101111110101100001111110101011100011010111000100000111111101000101001" + "1111111101010100011110101111010000101000100111100001100011111001001011110101111000010111111101000101001" + "1111111101010100010100111001110000100011000110010001110110001001100011010011101111000111111101000101001" + "1111111101010100011110100101000000111001011101100001111101110011001011010111111011110111111101000101001" + "1111111101010100011010011011111100100111001000001101000111011011100010100110001111100111111101000101001" + "1111111101010100010100011000001100100011100111001001000100010010000011010001100011100111111101000101001" + }, + /* 90*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCD123456789012ABC", 0, 7, 120, 0, "T4 N12 T3; BWIPP -> T19", + "111111110101010001111101010111110011101011011110000111101010111100001010011100111000011111010101111100111111101000101001" + "111111110101010001111101010001100010111111010011000111111010101110001001100011111010011110101001000000111111101000101001" + "111111110101010001010100111100000011101001111110110100000101011110001010000100111100011010100011111000111111101000101001" + "111111110101010001101011110011111010000110001100100111101010111100001110100011001111011010111100111110111111101000101001" + "111111110101010001101011100001000010111111010110000111100100100100001100010111001000011110101110011100111111101000101001" + "111111110101010001111101011110110010110100011100000100011110010001001101111000010110011110101111000010111111101000101001" + "111111110101010001110100111011111010011100011101000110110001000000101001100111011000011101001110111110111111101000101001" + }, + /* 91*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCD\177FGH", 0, 9, 103, 1, "BYTE1", + "1111111101010100011111010101111100110101000001100001000001000010001011110101011110000111111101000101001" + "1111111101010100011110101000010000110100111100011001100100111100011011110101001000000111111101000101001" + "1111111101010100011101010111111000111001100101111101111110010110010010101000011110000111111101000101001" + "1111111101010100011010111100111110110011100011000101101000101100000010101111001111000111111101000101001" + "1111111101010100011010111000001000111101001000100001011111101011000011110101110011100111111101000101001" + "1111111101010100011110101111010000101111100111011001001000100111100011110101111101100111111101000101001" + "1111111101010100011101001110111110100011000110010001010000001000001011010011101111000111111101000101001" + "1111111101010100011111101001011100111000010011001001111000101100011010101111110111000111111101000101001" + "1111111101010100011010011011111100100111000001001101100110110011111011111010011101000111111101000101001" + }, + /* 92*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABC+\177FGH", 0, 9, 103, 1, "BYTE1", + "1111111101010100011111010101111100110101000001100001000001000010001011110101011110000111111101000101001" + "1111111101010100011110101000010000110100111100011001100100111100011011110101001000000111111101000101001" + "1111111101010100011101010111111000100110010111000001101000001011111010101000011110000111111101000101001" + "1111111101010100011010111100111110100010111011100001101000101100000010101111001111000111111101000101001" + "1111111101010100011010111000001000111101001000100001011111101011000011110101110011100111111101000101001" + "1111111101010100011110101111010000110001100101111001010000001011110011110101111101100111111101000101001" + "1111111101010100011101001110111110100001001100110001101100010000010011010011101111000111111101000101001" + "1111111101010100011111101001011100111010000111001101110010011000001010101111110111000111111101000101001" + "1111111101010100011010011011111100100111101100001101001110110011100011111010011101000111111101000101001" + }, + /* 93*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABC+\177+GH", 0, 9, 103, 1, "BYTE1", + "1111111101010100011111010101111100110101000001100001000001000010001011110101011110000111111101000101001" + "1111111101010100011110101000010000110100111100011001100100111100011011110101001000000111111101000101001" + "1111111101010100011101010111111000100110010111000001101000001011111010101000011110000111111101000101001" + "1111111101010100011010111100111110110010000001011001101000101100000010101111001111000111111101000101001" + "1111111101010100011010111000001000111101001000100001011111101011000011110101110011100111111101000101001" + "1111111101010100011110101111010000110001111101010001010000010011110011110101111101100111111101000101001" + "1111111101010100011101001110111110111101000100111101101000110111000011010011101111000111111101000101001" + "1111111101010100011111101001011100110110001111001001110110111001000010101111110111000111111101000101001" + "1111111101010100011010011011111100110110001011110001000000100101111011111010011101000111111101000101001" + }, + /* 94*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCD+\177GH", 0, 8, 103, 0, "BYTE1; BWIPP different encodation (A5 B3)", + "1111111101010100011111010101111100110101000011000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111101010001110110101111110111101101111101011110011110101001000000111111101000101001" + "1111111101010100011101010111111000100111111001110101010000001011110011101010001111110111111101000101001" + "1111111101010100011010111100111110111000111010010001110110010001100010101111001111000111111101000101001" + "1111111101010100011101011100001100111101111011110101111000010100001011110101110011100111111101000101001" + "1111111101010100011110101111010000101110001000011001100111110100001011101011111010000111111101000101001" + "1111111101010100011101001110111110101000010000010001100110100000100011010011101111000111111101000101001" + "1111111101010100011111010010110000111100010001101101001001111100110010101111110111000111111101000101001" + }, + /* 95*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCD\177+GH", 0, 9, 103, 1, "BYTE1", + "1111111101010100011111010101111100110101000001100001000001000010001011110101011110000111111101000101001" + "1111111101010100011110101000010000110100111100011001100100111100011011110101001000000111111101000101001" + "1111111101010100011101010111111000111001100101111101111110010110010010101000011110000111111101000101001" + "1111111101010100011010111100111110100001000011011001101000101100000010101111001111000111111101000101001" + "1111111101010100011010111000001000111101001000100001011111101011000011110101110011100111111101000101001" + "1111111101010100011110101111010000100100100001111001001000101111000011110101111101100111111101000101001" + "1111111101010100011101001110111110100101111011110001000001000100010011010011101111000111111101000101001" + "1111111101010100011111101001011100111010110010000001110001011010000010101111110111000111111101000101001" + "1111111101010100011010011011111100111111001001101001001110000100110011111010011101000111111101000101001" + }, + /* 96*/ { BARCODE_PDF417, -1, UNICODE_MODE, -1, -1, -1, "ABCD+\177+GH", 0, 8, 103, 0, "BYTE1; BWIPP different encodation (A5 B4)", + "1111111101010100011111010101111100110101000011000001111010101111000011110101011110000111111101000101001" + "1111111101010100011111101010001110110101111110111101101111101011110011110101001000000111111101000101001" + "1111111101010100011101010111111000100111111001110101010000001011110011101010001111110111111101000101001" + "1111111101010100011010111100111110111000010010111001111011010000111010101111001111000111111101000101001" + "1111111101010100011101011100001100101001111000001001100100111100110011110101110011100111111101000101001" + "1111111101010100011110101111010000100011110100001001111010111100100011101011111010000111111101000101001" + "1111111101010100011101001110111110100000101100110001010011001100000011010011101111000111111101000101001" + "1111111101010100011111010010110000111101000001101101110101110000011010101111110111000111111101000101001" + }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -1653,14 +2083,15 @@ static void test_encode(int index, int generate, int debug) { char cmp_buf[32768]; char cmp_msg[1024]; - int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise - int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */ + int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); /* Only do ZXing-C++ test if asked, too slow otherwise */ testStart("test_encode"); for (i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; + if ((debug & ZINT_DEBUG_TEST_PRINT) && !(debug & ZINT_DEBUG_TEST_LESS_NOISY)) printf("i:%d\n", i); symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); @@ -1781,33 +2212,44 @@ static void test_encode_segs(int index, int generate, int debug) { "1111111101010100011111101001011100111100100010100001001111101011100010101111110111000111111101000101001" "1111111101010100011010011011111100100111010011000001100011010011110011111010011101000111111101000101001" }, - /* 4*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("product:Google Pixel 4a - 128 GB of Storage - Black;price:$439.97"), -1, 3 }, { TU("品名:Google 谷歌 Pixel 4a -128 GB的存储空间-黑色;零售价:¥3149.79"), -1, 29 }, { TU("Produkt:Google Pixel 4a - 128 GB Speicher - Schwarz;Preis:444,90 €"), -1, 17 } }, 0, 24, 188, 0, "AIM ITS/04-023:2022 Annex A example; BWIPP different encodation", - "11111111010101000111010100011100001001010000100000011000111000110010111010100111000001000011000110010011000001001011000100110001101000001101000010000110011010100011000000111111101000101001" - "11111111010101000111110101000001101111010011011000011110000011011010100000101111101101111011000011001011110100000100010110100011100001001110000110111010011111101010001110111111101000101001" - "11111111010101000110101000111110001101100010001111011100101011111100110011111011011001001011000111110011111101011100110100111110001100101100011110101100011111101011010000111111101000101001" - "11111111010101000111110100101111101101001111011111010000010100010000111110110100111101100000101001100010011011100001100110000010100110001110011000010011011110100101111000111111101000101001" - "11111111010101000110101111011000001110010000011001011111010100011000110100011100001001001111010001111011000001011101000101011111001100001001001111000001011101011100001100111111101000101001" - "11111111010101000111101011110000101010011101111110010000001100101110111100001011110101001000100001111010010110000111110100110000110111101101000001011111011101011111000100111111101000101001" - "11111111010101000101001111011110001111011000100111010010001110011100110001110001100101010111101111000010000010000100010111011011001110001110110100011000011010011100011110111111101000101001" - "11111111010101000111111010010011101110100000110001011100101111001110101111110101100001111000001101101011101000000110010111101100001100101111010000010001011111010010110000111111101000101001" - "11111111010101000101001100011111001111110010110001011001111110110010100100100111100001011011101111100010110110111100000101100100000111001100011111001001011111010011100100111111101000101001" - "11111111010101000110100011100111101111011110001001011000011010010000110000100011011101100010101100000010000110111101110100000101000001001000001010001000010100011100111000111111101000101001" - "11111111010101000110100111000000101000101111010000011111101001011100110000010111010001101000011110110011011111101011100110010011101000001111110111010010011101001110001100111111101000101001" - "11111111010101000101000110111110001000010100011110011111101011000100110011100010011101100110100111100010111000110011100110110000010111101001100110001111011111010001110100111111101000101001" - "11111111010101000101000001001000001100110000010001010001010000010000110011000001001001101111001110001010100000101000000110110011000011001100100000100011011101000001011100111111101000101001" - "11111111010101000111101000110110001101111101011110011111011001010000101110111111010001111001110011101011110100001001000101111110100110001111101011011100011111010001000110111111101000101001" - "11111111010101000101000001101111101001110011001110011000111110010010101111110011100101110110111111001010000111110110010111111010110001001100011111001001011100101011111100111111101000101001" - "11111111010101000111100101101111101001100110000100010011000110100000110100001000011001011000111000011011100111101100010100000101110011101110111010100000011100101101111000111111101000101001" - "11111111010101000101000111111011101111010000010001011010001110000100111000011011101001001011111101110011110100011011000110000010111010001101000111000001010100011111011000111111101000101001" - "11111111010101000111110010111101101111110101110011010011111000110010110001111010110001111101001110100011001111101101100100100101111000001000111101110111011100101111100100111111101000101001" - "11111111010101000111101101000011101100000100101100011010000010011000101001111011110001010000011000110010000010100010000111011100100000101000001000101000011101101000011000111111101000101001" - "11111111010101000111101000001000101000001011110100011100101100000100111101011001100001111001110011101011101011101100000111100010110011001111010001000010010100001111100110111111101000101001" - "11111111010101000110010010011111001011110010000010010111000100110000101000001001111001011100100011000011111101011100110100111111001110101110010111111011010010010000111100111111101000101001" - "11111111010101000101101110001100001000011000110010010000110001100100100001100011001001000011000110010010000110001100100110011000010010001101110110100000011101101110011110111111101000101001" - "11111111010101000111100101000000101111010000010001010100011110010000101110100111110001110000010110001011101000011000010110110001111001001100010111000100011111001010001100111111101000101001" - "11111111010101000111001001111101001011101100011100011001110010001110110000111110100101001111001100011010110011001111000101100100001110001101111001000011011001001111110010111111101000101001" + /* 4*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("$439.97"), -1, 3 }, { TU("¥3149.79"), -1, 29 }, { TU("Produkt:444,90 €"), -1, 17 } }, 0, 10, 137, 0, "AIM ITS/04-023:2022 Annex A example; BWIPP different encodation", + "11111111010101000111010100111000001101011110011111011000111000110010111010100111000001000001000101000011101010011100000111111101000101001" + "11111111010101000111110101000110001111110100010111011110110110000100111110010010110001001111110010110011111010100110000111111101000101001" + "11111111010101000110101001111100001010111000111111011001111110110010110010111111010001110010111111011011010100011111000111111101000101001" + "11111111010101000101011111011111001000011000110010010000010011101110111110101111110101111011000100111010101111101111100111111101000101001" + "11111111010101000110101110000100001111100101000011010011111100101100111101011001100001001111010011110011010111000100000111111101000101001" + "11111111010101000111101011110010001101111110110100011101110001011110101111000010000101001110000100110011110101111000010111111101000101001" + "11111111010101000101001110011100001000100110000110010100000101000000111000100101110001110101110011111010100111001110000111111101000101001" + "11111111010101000111101001010000001011111100100011011110100001001000101111110101100001011111101011000011010111111011110111111101000101001" + "11111111010101000101001100111110001100011110001011010110001100111100100001100100111001001111001001000010100110001111100111111101000101001" + "11111111010101000101000110000011001110111101110011011101110110011000111100111001001101101011110111110010100011000001100111111101000101001" }, - /* 5*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("\357"), 1, 0 }, { TU("\357"), 1, 7 }, { TU("\357"), 1, 0 } }, 0, 10, 103, 1, "Standard example + extra seg, data mode", + /* 5*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("product:Google Pixel 4a - 128 GB of Storage - Black;price:$439.97"), -1, 3 }, { TU("品名:Google 谷歌 Pixel 4a -128 GB的存储空间-黑色;零售价:¥3149.79"), -1, 29 }, { TU("Produkt:Google Pixel 4a - 128 GB Speicher - Schwarz;Preis:444,90 €"), -1, 17 } }, 0, 23, 188, 0, "AIM ITS/04-023:2022 Annex A example; BWIPP different encodation", + "11111111010101000111010100011100001111100101011111011000111000110010111010100111000001100000100101100010011000110100000110100001000011001110100010001110011010100011000000111111101000101001" + "11111111010101000111101010000010001111000001101101010000010111110110111101100001100101111010000010001011010001110000100111000011011101001001011111101110011111101010001110111111101000101001" + "11111111010101000110101000111110001110010101111110011001111101101100100101100011111001111110101110011010011111000110010110001111010110001111101001110100010101000001111000111111101000101001" + "11111111010101000111110100101111101000001010001000011111011010011110110000010100110001001101110000110011000001010011000111001100001001101110111010010000011110100101111000111111101000101001" + "11111111010101000110101110000001001111101010001100011010001110000100100111101000111101100000101110100010101111100110000100100111100000101111101001001100011101011100001100111111101000101001" + "11111111010101000111101011110000101000000110010111011110000101111010100100010000111101001011000011111010011000011011110110100000101111101011000001001110011110101111100110111111101000101001" + "11111111010101000101001111011110001001000111001110011000111000110010101011110111100001000001000010001011101101100111000111011010001100001110010010011100011010011100011110111111101000101001" + "11111111010101000111110100100110001110010111100111010111111010110000111100000110110101110100000011001011110110000110010111101000001000101101000111000010011111010010110000111111101000101001" + "11111111010101000101001100011111001100111111011001010010010011110000101101110111110001011011011110000010110010000011100110001111100100101000111101100011010100111011111100111111101000101001" + "11111111010101000110100011100111101100001101001000011000010001101110110001010110000001000011011110111010000010100000100100000101000100001000100011011000010100011100111000111111101000101001" + "11111111010101000110100111000001001111110100101110011000001011101000110100001111011001101111110101110011001001110100000111111011101001001111000101000001011101001110001100111111101000101001" + "11111111010101000101000110111110001111110101100010011001110001001110110011010011110001011100011001110011011000001011110100110011000111101011110001010000010100011000111110111111101000101001" + "11111111010101000101000001001000001000101000001000011001100000100100110111100111000101010000010100000011011001100001100110010000010001101000001000100100011101000001011100111111101000101001" + "11111111010101000111010001101000001111101100101000010111011111101000111100111001110101111010000100100010111111010110000111100011101110101110101110001100011111010001000110111111101000101001" + "11111111010101000101000001101111101011000001001110011101101111110010100001111101100101111110101100010010111111001110100110111111011010001110111000101111011001010111110000111111101000101001" + "11111111010101000111100101101111101000010110000011011000010100001100111100110010111001100100100110000010001001110111000101100001101000001100000101001100011100101101111000111111101000101001" + "11111111010101000101000111110001101111100010100110010001101001111110111100100010000101110000010001101011000001011100100110000010111010001111001101101000010100011111011000111111101000101001" + "11111111010101000111110010111101101111101011110110010010000101111000111011111100101001010010000111100011011110010000110100110000001011101001000100001111011110010111110110111111101000101001" + "11111111010101000111101101000011101011011100110000010001000010000010110000110010000101000001010001000010011000011010000101001111011110001110011101000100011101101000011000111111101000101001" + "11111111010101000111101000001001001100010011110110011011111001011110111000011011101001110001001101000011001011111011100110011110101111101111010001001000010100001111100110111111101000101001" + "11111111010101000110010010011111001100101001111100010110001100111100110001111001001101001111110011101011100101111110110101011100111111001100100101111100010110110001111000111111101000101001" + "11111111010101000101101110001100001100111000110100010001100110010000111011110110001001111101110100111010000100100000010111000101101111001011100111010000011101101110011110111111101000101001" + "11111111010101000111100101000001001100000110111101011101001110001100111100010111011101101101111000010011111000011010010101101111101000001100100001111011011111001010001100111111101000101001" + }, + /* 6*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("\357"), 1, 0 }, { TU("\357"), 1, 7 }, { TU("\357"), 1, 0 } }, 0, 10, 103, 1, "Standard example + extra seg, data mode", "1111111101010100011101010011100000110101101110000001111001111001010011110101011110000111111101000101001" "1111111101010100011111010100011000111100101110011101001111110010110011111010100110000111111101000101001" "1111111101010100011101010111111000111010100011111101001111110011101011010100011111000111111101000101001" @@ -1819,7 +2261,7 @@ static void test_encode_segs(int index, int generate, int debug) { "1111111101010100011010011011111100110100111111010001001011101111110010100110001111100111111101000101001" "1111111101010100010100011000001100111100100100111101100011001010000011010001100011100111111101000101001" }, - /* 6*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("Τεχτ"), -1, 9 }, { TU("กขฯ"), -1, 0 }, { TU("貫やぐ禁"), -1, 20 } }, ZINT_WARN_USES_ECI, 11, 120, 1, "Auto-ECI", + /* 7*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("Τεχτ"), -1, 9 }, { TU("กขฯ"), -1, 0 }, { TU("貫やぐ禁"), -1, 20 } }, ZINT_WARN_USES_ECI, 11, 120, 1, "Auto-ECI", "111111110101010001110101001110000011010111001111000110001110001100101010100000100000011111010101111100111111101000101001" "111111110101010001111110101000111011011111101011100111111001010111001111001011000110011111010100110000111111101000101001" "111111110101010001010100111100000010110011101111100111111001000110101000011111011001011101010001111110111111101000101001" @@ -1832,7 +2274,7 @@ static void test_encode_segs(int index, int generate, int debug) { "111111110101010001010001100000110011001000010011000110011000110011001011110011110010010100011000011000111111101000101001" "111111110101010001110100111000110011010001111011000110000110111100101101001111000011011010011100100000111111101000101001" }, - /* 7*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 2, 4, "017053" }, { { TU("Τεχτ"), -1, 9 }, { TU("กขฯ"), -1, 13 }, { TU("貫やぐ禁"), -1, 20 } }, 0, 11, 120, 1, "Structured Append", + /* 8*/ { BARCODE_PDF417, UNICODE_MODE, -1, -1, -1, { 2, 4, "017053" }, { { TU("Τεχτ"), -1, 9 }, { TU("กขฯ"), -1, 13 }, { TU("貫やぐ禁"), -1, 20 } }, 0, 11, 120, 1, "Structured Append", "111111110101010001110101001110000011010111001111000110001110001100101010100000100000011111010101111100111111101000101001" "111111110101010001111110101000111011011111101011100111111001010111001111001011000110011111010100110000111111101000101001" "111111110101010001010100111100000010110011101111100111111001000110101000011111011001011101010001111110111111101000101001" @@ -1845,7 +2287,7 @@ static void test_encode_segs(int index, int generate, int debug) { "111111110101010001010001100000110011001000010011000110011000110011001011110011110010010100011000011000111111101000101001" "111111110101010001110100111000110011010001111011000110000110111100101101001111000011011010011100100000111111101000101001" }, - /* 8*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("¶¶"), -1, 0 }, { TU("ЖЖ"), -1, 7 }, { TU(""), 0, 0 } }, 0, 8, 82, 1, "Standard example (doubled to avoid Byte Shift)", + /* 9*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("¶¶"), -1, 0 }, { TU("ЖЖ"), -1, 7 }, { TU(""), 0, 0 } }, 0, 8, 82, 1, "Standard example (doubled to avoid Byte Shift)", "1100111010100000100001000101000010110110110100010000001101101000100000011001110101" "1110111010100111111001011001000010010111111010100011101101111110101110011101110101" "1110011010110010010111110001000011010110010010111110001100011111001001011100110101" @@ -1855,7 +2297,7 @@ static void test_encode_segs(int index, int generate, int debug) { "1100001010111011100010100001001100010101110001110010001100100111011110011000010101" "1100011010101111100100111001001110010111010001100010001111000101000001011000110101" }, - /* 9*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("¶¶"), -1, 0 }, { TU("ЖЖ"), -1, 0 }, { TU(""), 0, 0 } }, ZINT_WARN_USES_ECI, 8, 82, 1, "Standard example auto-ECI", + /* 10*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("¶¶"), -1, 0 }, { TU("ЖЖ"), -1, 0 }, { TU(""), 0, 0 } }, ZINT_WARN_USES_ECI, 8, 82, 1, "Standard example auto-ECI", "1100111010100000100001000101000010110110110100010000001101101000100000011001110101" "1110111010100111111001011001000010010111111010100011101101111110101110011101110101" "1110011010110010010111110001000011010110010010111110001100011111001001011100110101" @@ -1865,7 +2307,7 @@ static void test_encode_segs(int index, int generate, int debug) { "1100001010111011100010100001001100010101110001110010001100100111011110011000010101" "1100011010101111100100111001001110010111010001100010001111000101000001011000110101" }, - /* 10*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("ЖЖ"), -1, 7 }, { TU("¶¶"), -1, 0 }, { TU(""), 0, 0 } }, 0, 8, 82, 1, "Standard example inverted", + /* 11*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("ЖЖ"), -1, 7 }, { TU("¶¶"), -1, 0 }, { TU(""), 0, 0 } }, 0, 8, 82, 1, "Standard example inverted", "1100111010110001110001100101000010110111010100011100001000001000010001011001110101" "1110111010101000011110010001000010010101000011110010001001111110010110011101110101" "1110011010110101001111100001000011010110011111101100101100100101111100011100110101" @@ -1875,7 +2317,7 @@ static void test_encode_segs(int index, int generate, int debug) { "1100001010110100001000110001001100010111010010000111001110001100010011011000010101" "1100011010111110111011000101001110010111011000111000101110100111000110011000110101" }, - /* 11*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("ЖЖ"), -1, 0 }, { TU("¶¶"), -1, 0 }, { TU(""), 0, 0 } }, ZINT_WARN_USES_ECI, 8, 82, 1, "Standard example inverted auto-ECI", + /* 12*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("ЖЖ"), -1, 0 }, { TU("¶¶"), -1, 0 }, { TU(""), 0, 0 } }, ZINT_WARN_USES_ECI, 8, 82, 1, "Standard example inverted auto-ECI", "1100111010110001110001100101000010110111010100011100001000001000010001011001110101" "1110111010101000011110010001000010010101000011110010001001111110010110011101110101" "1110011010110101001111100001000011010110011111101100101100100101111100011100110101" @@ -1885,7 +2327,7 @@ static void test_encode_segs(int index, int generate, int debug) { "1100001010110100001000110001001100010111010010000111001110001100010011011000010101" "1100011010111110111011000101001110010111011000111000101110100111000110011000110101" }, - /* 12*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 4, -1, { 0, 0, "" }, { { TU("product:Google Pixel 4a 128 GB Black;price:$439.97"), -1, 3 }, { TU("品名:Google 谷歌 Pixel 4a 128 GB 黑色;零售价:¥3149.79"), -1, 29 }, { TU("Produkt:Google Pixel 4a 128 GB Schwarz;Preis:444,90 €"), -1, 17 } }, 0, 44, 99, 0, "AIM ITS/04-023:2022 Annex A example (shortened); BWIPP different encodation", + /* 13*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, 4, -1, { 0, 0, "" }, { { TU("product:Google Pixel 4a 128 GB Black;price:$439.97"), -1, 3 }, { TU("品名:Google 谷歌 Pixel 4a 128 GB 黑色;零售价:¥3149.79"), -1, 29 }, { TU("Produkt:Google Pixel 4a 128 GB Schwarz;Preis:444,90 €"), -1, 17 } }, 0, 44, 99, 0, "AIM ITS/04-023:2022 Annex A example (shortened); BWIPP different encodation", "110010001011000111000110010111010100111000001011000010100001100011001001100000100101100011010001001" "111010001011000100111010000101001111000010001011100010111101001101100001111000001101101011010001101" "111011001010001111001101100101110001100111001011100110100100100001111001111110010110001011010000101" @@ -1905,33 +2347,33 @@ static void test_encode_segs(int index, int generate, int debug) { "111101001011011111101011100110110111100010001010001100111110100010110001100011001111001011000010101" "111101011010011001000011100110001111000101101010011100110001000101111101000111001011000011000110101" "111101010010100010000010000111101000101111001010011000111101110100110001001011000011000011000100101" - "111001010011110100001001000101111110100110001010111000111110101101110001011101011111000011100100101" - "111011010011000111110010010101111110011100101010110000111011011111100101000011111011001011110100101" - "111010010011110101100111110100001100011001001010010000100110011000010001001100011010000011110101101" - "111010011010100111100001000110010011110110001011010000111100000110110101000001011111011011110101001" - "111010111010111000110011100100100100001111001001010000111111001011000101100111110010100011100101001" - "111010110011001000110111000110100000100011001001011000100000101000100001110010100111000011101101001" - "111010100011101011000000100111100000100010101001011100111111010010111001100000101110100011101001001" - "110010100010010010111100000100011110111011101011011100100111110110001001011001000001110011101001101" - "110010110011110101100111110110111100111000101011011110101011100011100001110001000100111011101011101" - "110010111011110100010000100111100010001010001011001110100100001111000101111010001001000011101011001" - "110010011010111001000110000111111010111001101001001110100111111001110101110010111111011011101010001" + "111001010011110100001001000101111110101100001010111000111100011101110101110101110001100011100100101" + "111011010010110000010011100111011011111100101010110000100001111101100101111110101100010011110100101" + "111010010011000111011000100110000110110110001010010000100110111000110001000010110000011011110101101" + "111010011011000100011110110111110110000010101011010000111010000011001001001000011111011011110101001" + "111010111010011011001111000100111110110100001001010000100001010111100001110011110010111011100101001" + "111010110011000101011000000100001101111011101001011000100000101000001001000001010001000011101101001" + "111010100011110101110011100111111011010110001001011100111000111011110101110101111101111011101001001" + "110010100011011110010000110101001100001111101011011100111001111010011101100111001001110011101001101" + "110010110010000010001101100110000010010110001011011110111011100110011001011001100001000011101011101" + "110010111011001111010111110111101000100100001011001110111010001100100001011010011111100011101011001" + "110010011011000111100100110100111111001110101001001110111001011111101101100011111001001011101010001" "110011011010000110001100100100001100011001001001101110100001100011001001000011000110010011001010001" - "111011011010111111010110000101111110101100001000101110111110101100011101101110011111010011001011001" - "111001011011011110010011000111111000101100101000100110101111011101110001000011010111000011001011101" - "110001011010011000110100000110000100011011101000110110111000110001001101001101111101111011001001101" - "110001010010011111010011100110110011110001001000010110111101100111001101111010000010100011001101101" - "110011010011111001000111010100010000101111001000010010111010001011111101001100001000111011101101101" - "110111010010001100110000010100001100110010001000011010100010001100001101100100000100011011100101101" - "110110010011101111011111010111111011010011001000111010111100010100100001110000110111010011000101101" - "110110011010011001001110000111001111101001101000110010101110010001100001000101100111110011000101001" - "110110111011101101100111000100110001110110001000100010110111100011100101000110110010000011001101001" - "110110110011111011100110100111001000001100101001100010111101100110000101100100000111001011011101001" - "110110100011101110010111100110001111010001101001110010110111111001101001011010000011100011011001001" - "110100100010110011110001110101100001100010001001111010111011000100110001010000011001100011011001101" - "110101100011111011000010100111110100001011001011111010111110111011000101011101111110001011011011101" + "111011011010111111010110000101111110101100001000101110110011101111101001111110001110101011001011001" + "111001011010011000010011100101001000011110001000100110111111001011001001000111100100001011001011101" + "110001011011100100010011100100110001101000001000110110111010010011100001101111101111010011001001101" + "110001010011010011101000000111101000001101101000010110111110001010001101001111110101100011001101101" + "110011010010010000010011110100111110011010001000010010100011000100011101000111000110111011101101101" + "110111010011100111101100100101001000001000001000011010101000010001000001011101110001000011100101101" + "110110010010001011111001100100001011111001101000111010101111110100011001110001011110111011000101101" + "110110011011000111110110110110100001001111101000110010111011110100111001001001100111110011000101001" + "110110111011101110110011000101100000110001001000100010111010011011110001100100011101111011001101001" + "110110110011110010100010000111001000001101001001100010111011000011101001110001000011010011011101001" + "110110100011001111010110000110101101111110001001110010101110001100011101111110100001101011011001001" + "110100100011100110100001100100110011010000001001111010110110000100001001001100111011000011011001101" + "110101100011011101111101000111100101001000001011111010111111000111010101110010011100011011011011101" }, - /* 13*/ { BARCODE_MICROPDF417, DATA_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("\357\357"), 2, 0 }, { TU("\357\357"), 2, 7 }, { TU("\357\357"), 2, 0 } }, 0, 10, 82, 1, "Standard example (doubled) + extra seg, data mode", + /* 14*/ { BARCODE_MICROPDF417, DATA_MODE, -1, 3, -1, { 0, 0, "" }, { { TU("\357\357"), 2, 0 }, { TU("\357\357"), 2, 7 }, { TU("\357\357"), 2, 0 } }, 0, 10, 82, 1, "Standard example (doubled) + extra seg, data mode", "1100010010110011111101100101001111010101100110011110001011001100111100011000100101" "1110010010110001110001100101011111010111010100011100001000001000010001011100100101" "1111010010111100101110011101011110010111100101110011101001111110010110011110100101" @@ -1943,7 +2385,7 @@ static void test_encode_segs(int index, int generate, int debug) { "1110100110111101000011001101001000110111101001000100001100100111010000011101001101" "1110101110100000101101111101001000010111010011111000101001110111001111011101011101" }, - /* 14*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("Τεχτ"), -1, 9 }, { TU("กขฯ"), -1, 0 }, { TU("貫やぐ禁"), -1, 20 } }, ZINT_WARN_USES_ECI, 17, 55, 1, "Auto-ECI", + /* 15*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("Τεχτ"), -1, 9 }, { TU("กขฯ"), -1, 0 }, { TU("貫やぐ禁"), -1, 20 } }, ZINT_WARN_USES_ECI, 17, 55, 1, "Auto-ECI", "1100110100100001111101100101101010000111110011001101001" "1101110100100000100001000101100100110011100011011101001" "1101100100111100101100011001100101111011000011011001001" @@ -1962,7 +2404,7 @@ static void test_encode_segs(int index, int generate, int debug) { "1101000010110000011010111101100110010001111011010000101" "1101100010100001001101100001001001110111000011011000101" }, - /* 15*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 3, 4, "017053" }, { { TU("Τεχτ"), -1, 9 }, { TU("กขฯ"), -1, 13 }, { TU("貫やぐ禁"), -1, 20 } }, 0, 17, 55, 1, "Structured Append", + /* 16*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 3, 4, "017053" }, { { TU("Τεχτ"), -1, 9 }, { TU("กขฯ"), -1, 13 }, { TU("貫やぐ禁"), -1, 20 } }, 0, 17, 55, 1, "Structured Append", "1100110100100001111101100101101010000111110011001101001" "1101110100100000100001000101100100110011100011011101001" "1101100100111100101100011001100101111011000011011001001" @@ -1981,7 +2423,7 @@ static void test_encode_segs(int index, int generate, int debug) { "1101000010110000011010111101100110010001111011010000101" "1101100010100001001101100001001001110111000011011000101" }, - /* 16*/ { BARCODE_PDF417COMP, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("¶"), -1, 0 }, { TU("Ж"), -1, 7 }, { TU(""), 0, 0 } }, 0, 8, 69, 1, "Standard example", + /* 17*/ { BARCODE_PDF417COMP, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("¶"), -1, 0 }, { TU("Ж"), -1, 7 }, { TU(""), 0, 0 } }, 0, 8, 69, 1, "Standard example", "111111110101010001111101010111110011010100001100000111100111100101001" "111111110101010001111110101000111010100001111001000100111111001011001" "111111110101010001110101011111100011101010001111110100111111001110101" @@ -1991,10 +2433,10 @@ static void test_encode_segs(int index, int generate, int debug) { "111111110101010001110100111011111010100011101110000100011101110010001" "111111110101010001111101001011000011100010111011000110101110000100001" }, - /* 17*/ { BARCODE_HIBC_PDF, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("H123ABC"), -1, 0 }, { TU("012345678"), -1, 0 }, { TU("90D"), -1, 20 } }, ZINT_ERROR_INVALID_OPTION, 0, 0, 1, "HIBC", + /* 18*/ { BARCODE_HIBC_PDF, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("H123ABC"), -1, 0 }, { TU("012345678"), -1, 0 }, { TU("90D"), -1, 20 } }, ZINT_ERROR_INVALID_OPTION, 0, 0, 1, "HIBC", "" }, - /* 18*/ { BARCODE_HIBC_MICPDF, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("H123ABC"), -1, 0 }, { TU("012345678"), -1, 0 }, { TU("90D"), -1, 20 } }, ZINT_ERROR_INVALID_OPTION, 0, 0, 1, "HIBC", + /* 19*/ { BARCODE_HIBC_MICPDF, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, { { TU("H123ABC"), -1, 0 }, { TU("012345678"), -1, 0 }, { TU("90D"), -1, 20 } }, ZINT_ERROR_INVALID_OPTION, 0, 0, 1, "HIBC", "" }, }; @@ -2006,8 +2448,8 @@ static void test_encode_segs(int index, int generate, int debug) { char cmp_buf[32768]; char cmp_msg[1024]; - int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise - int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */ + int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); /* Only do ZXing-C++ test if asked, too slow otherwise */ testStart("test_encode_segs"); @@ -2096,7 +2538,7 @@ static void test_encode_segs(int index, int generate, int debug) { testFinish(); } -// #181 Nico Gunkel OSS-Fuzz +/* #181 Nico Gunkel OSS-Fuzz */ static void test_fuzz(int index, int debug) { struct item { @@ -2133,7 +2575,7 @@ static void test_fuzz(int index, int debug) { "\060\204\041\060\075\060\204\060\075\060\075\204\060\075\060\103\204\060\204\060\003\120\060\075\060\004\060\204\060\074\204\060\204\060\075\204\060\075\060\103" "\204\060\214\060\204\060\075\060\073\060\075\060\204\060\103\204\060\075\060\204\060\204\060\122\060\000\060\075\060\000\076\060\100\000\060\004\060\103\204\060" "\204\060\003\060\204\075\060\120\214\060\204\060\004\060\103\204\060\204\060\003\060\211\074\060\120\060\124\060\351\060\120\060\075\060\351\060\072\375\060\204\060", - 1001, -1, ZINT_ERROR_TOO_LONG }, // Original OSS-Fuzz triggering data + 1001, -1, ZINT_ERROR_TOO_LONG }, /* Original OSS-Fuzz triggering data */ /* 1*/ { BARCODE_PDF417COMP, "\060\075\204\060\204\060\204\041\060\075\060\204\060\075\060\075\204\060\075\060\103\204\060\204\060\003\120\060\075\060\004\060\204\060\074\204\060\204\060\075" "\204\060\075\060\103\204\060\214\060\204\060\075\060\031\060\073\060\025\060\075\060\204\060\103\204\060\075\060\204\060\000\075\060\226\060\100\204\060\204\060" @@ -2208,7 +2650,7 @@ static void test_fuzz(int index, int debug) { "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "1234567890", - 2710, 0, 0 }, // Max numerics with ECC 0 + 2710, 0, 0 }, /* Max numerics with ECC 0 */ /* 4*/ { BARCODE_PDF417, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" @@ -2248,7 +2690,7 @@ static void test_fuzz(int index, int debug) { "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678", - 2528, -1, 0 }, // Max numerics with ECC 5 + 2528, -1, 0 }, /* Max numerics with ECC 5 */ /* 6*/ { BARCODE_PDF417, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -2265,7 +2707,7 @@ static void test_fuzz(int index, int debug) { "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZABCD", - 1850, 0, 0 }, // Max text with ECC 0 + 1850, 0, 0 }, /* Max text with ECC 0 */ /* 7*/ { BARCODE_PDF417, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -2312,7 +2754,7 @@ static void test_fuzz(int index, int debug) { "\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240" "\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240" "\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240", - 1108, 0, 0 }, // Max bytes with ECC 0 + 1108, 0, 0 }, /* Max bytes with ECC 0 */ /* 9*/ { BARCODE_PDF417, "\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240" "\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240" @@ -2347,7 +2789,7 @@ static void test_fuzz(int index, int debug) { "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "123456789012345678901234567890123456789012345678901234567890123456", - 366, -1, 0 }, // Max numerics + 366, -1, 0 }, /* Max numerics */ /*11*/ { BARCODE_MICROPDF417, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" @@ -2356,7 +2798,7 @@ static void test_fuzz(int index, int debug) { /*12*/ { BARCODE_MICROPDF417, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP", - 250, -1, 0 }, // Max text + 250, -1, 0 }, /* Max text */ /*13*/ { BARCODE_MICROPDF417, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ", @@ -2395,13 +2837,176 @@ static void test_fuzz(int index, int debug) { testFinish(); } +INTERNAL void pdf_numbprocess_test(int *chainemc, int *mclength, const unsigned char chaine[], const int start, + const int length); + +#include "../large.h" + +/* Max codewords 12 */ +static int annex_d_decode_dump(int chainemc[], int mclength, unsigned char *chaine, int length, char *buf1, char *buf2) { + static large_int pow900s[] = { + { 0x1, 0 }, /*1*/ + { 0x384, 0 }, /*900*/ + { 0xC5C10, 0 }, /*810000*/ + { 0x2B73A840, 0 }, /*729000000*/ + { 0x98C29B8100, 0 }, /*656100000000*/ + { 0x2190C2AB18400, 0 }, /*590490000000000*/ + { 0x7600EC618141000, 0 }, /*531441000000000000*/ + { 0xEDB3F06CA6884000, 0x19 }, /*478296900000000000000*/ + { 0xAC993DF977010000, 0x5B27 }, /*430467210000000000000000*/ + { 0xCABDE1065F840000, 0x140777A }, /*387420489000000000000000000*/ + { 0xC38B1A67CC100000, 0x466A40BB0 }, /*348678440100000000000000000000*/ + { 0x7508D4E968400000, 0xF78D8B9196F }, /*313810596090000000000000000000000*/ + }; + static large_int pow10s[] = { + { 1, 0 }, /*1*/ + { 0xA, 0 }, /*10*/ + { 0x64, 0 }, /*100*/ + { 0x3E8, 0 }, /*1000*/ + { 0x2710, 0 }, /*10000*/ + { 0x186A0, 0 }, /*100000*/ + { 0xF4240, 0 }, /*1000000*/ + { 0x989680, 0 }, /*10000000*/ + { 0x5F5E100, 0 }, /*100000000*/ + { 0x3B9ACA00, 0 }, /*1000000000*/ + { 0x2540BE400, 0 }, /*10000000000*/ + { 0x174876E800, 0 }, /*100000000000*/ + { 0xE8D4A51000, 0 }, /*1000000000000*/ + { 0x9184E72A000, 0 }, /*10000000000000*/ + { 0x5AF3107A4000, 0 }, /*100000000000000*/ + { 0x38D7EA4C68000, 0 }, /*1000000000000000*/ + { 0x2386F26FC10000, 0 }, /*10000000000000000*/ + { 0x16345785D8A0000, 0 }, /*100000000000000000*/ + { 0xDE0B6B3A7640000, 0 }, /*1000000000000000000*/ + { 0x8AC7230489E80000, 0 }, /*10000000000000000000*/ + { 0x6BC75E2D63100000, 0x5 }, /*100000000000000000000*/ + { 0x35C9ADC5DEA00000, 0x36 }, /*1000000000000000000000*/ + }; + int i; + large_int t, s, e; + + if (mclength > 12 + 1) { + return -1; + } + + large_load_u64(&t, 0); + for (i = 1; i < mclength; i++) { + large_load(&s, &pow900s[mclength - i - 1]); + large_mul_u64(&s, chainemc[i]); + large_add(&t, &s); + } + large_dump(&t, buf1); + + large_load_str_u64(&e, chaine, length); + large_add(&e, &pow10s[length]); /* Add "1" prefix */ + large_dump(&e, buf2); + + return 0; +} + +static void test_numbprocess(int index) { + + struct item { + unsigned char *chaine; + int expected_len; + int expected[16]; + }; + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ + struct item data[] = { + /* 0*/ { TU("1"), 2, { 902, 11, }, }, + /* 1*/ { TU("9"), 2, { 902, 19, }, }, + /* 2*/ { TU("12"), 2, { 902, 112, }, }, + /* 3*/ { TU("99"), 2, { 902, 199, }, }, + /* 4*/ { TU("000"), 3, { 902, 1, 100, }, }, + /* 5*/ { TU("123"), 3, { 902, 1, 223, }, }, + /* 6*/ { TU("999"), 3, { 902, 2, 199, }, }, + /* 7*/ { TU("1234"), 3, { 902, 12, 434, }, }, + /* 8*/ { TU("9999"), 3, { 902, 22, 199, }, }, + /* 9*/ { TU("12345"), 3, { 902, 124, 745, }, }, + /* 10*/ { TU("99999"), 3, { 902, 222, 199, }, }, + /* 11*/ { TU("000000"), 4, { 902, 1, 211, 100, }, }, + /* 12*/ { TU("123456"), 4, { 902, 1, 348, 256, }, }, + /* 13*/ { TU("999999"), 4, { 902, 2, 422, 199, }, }, + /* 14*/ { TU("1234567"), 4, { 902, 13, 782, 767, }, }, + /* 15*/ { TU("9999999"), 4, { 902, 24, 622, 199, }, }, + /* 16*/ { TU("12345678"), 4, { 902, 138, 628, 478, }, }, + /* 17*/ { TU("99999999"), 4, { 902, 246, 822, 199, }, }, + /* 18*/ { TU("000000000"), 5, { 902, 1, 334, 511, 100, }, }, + /* 19*/ { TU("123456789"), 5, { 902, 1, 486, 885, 289, }, }, + /* 20*/ { TU("999999999"), 5, { 902, 2, 669, 122, 199, }, }, + /* 21*/ { TU("1234567890"), 5, { 902, 15, 369, 753, 190, }, }, + /* 22*/ { TU("9999999999"), 5, { 902, 27, 391, 322, 199, }, }, + /* 23*/ { TU("12345678901"), 5, { 902, 154, 98, 332, 101, }, }, + /* 24*/ { TU("99999999999"), 5, { 902, 274, 313, 522, 199, }, }, + /* 25*/ { TU("000000000000"), 6, { 902, 1, 471, 667, 811, 100, }, }, + /* 26*/ { TU("123456789012"), 6, { 902, 1, 641, 83, 621, 112, }, }, + /* 27*/ { TU("999999999999"), 6, { 902, 3, 43, 435, 722, 199, }, }, + /* 28*/ { TU("1234567890123"), 6, { 902, 17, 110, 836, 811, 223, }, }, + /* 29*/ { TU("9999999999999"), 6, { 902, 30, 434, 758, 22, 199, }, }, + /* 30*/ { TU("12345678901234"), 6, { 902, 171, 209, 269, 12, 434, }, }, + /* 31*/ { TU("99999999999999"), 6, { 902, 304, 748, 380, 222, 199, }, }, + /* 32*/ { TU("000000000000000"), 7, { 902, 1, 624, 142, 101, 211, 100, }, }, + /* 33*/ { TU("123456789012345"), 7, { 902, 1, 812, 292, 890, 124, 745, }, }, + /* 34*/ { TU("999999999999999"), 7, { 902, 3, 348, 284, 202, 422, 199, }, }, + /* 35*/ { TU("000213298174000"), 7, { 902, 1, 624, 434, 632, 282, 200, }, }, /* ISO/IEC 15438:2015 Annex D example */ + /* 36*/ { TU("12345678901234567"), 7, { 902, 190, 232, 498, 813, 782, 767, }, }, + /* 37*/ { TU("99999999999999999"), 7, { 902, 338, 631, 522, 446, 822, 199, }, }, + /* 38*/ { TU("000000000000000000"), 8, { 902, 1, 793, 457, 812, 434, 511, 100, }, }, + /* 39*/ { TU("123456789012345678"), 8, { 902, 2, 102, 525, 489, 38, 628, 478, }, }, + /* 40*/ { TU("1234567890123456789"), 8, { 902, 21, 125, 755, 390, 386, 885, 289, }, }, + /* 41*/ { TU("9999999999999999999"), 8, { 902, 37, 570, 158, 49, 591, 322, 199, }, }, + /* 42*/ { TU("12345678901234567890"), 8, { 902, 211, 358, 354, 304, 269, 753, 190, }, }, + /* 43*/ { TU("99999999999999999999"), 8, { 902, 376, 301, 680, 496, 513, 522, 199, }, }, + /* 44*/ { TU("000000000000000000000"), 9, { 902, 2, 81, 608, 702, 682, 767, 811, 100, }, }, + /* 45*/ { TU("123456789012345678901"), 9, { 902, 2, 313, 883, 843, 342, 898, 332, 101, }, }, + /* 46*/ { TU("999999999999999999999"), 9, { 902, 4, 163, 317, 505, 465, 635, 722, 199, }, }, + /* 47*/ { TU("12345678901234567890123456789012345678901"), 15, { 902, 441, 883, 33, 675, 271, 780, 283, 607, 83, 596, 420, 698, 332, 101, }, }, + /* 48*/ { TU("99999999999999999999999999999999999999999"), 15, { 902, 786, 741, 209, 58, 439, 392, 682, 346, 534, 445, 515, 80, 222, 199, }, }, + /* 49*/ { TU("000000000000000000000000000000000000000000"), 16, { 902, 4, 334, 106, 145, 292, 397, 163, 711, 832, 872, 427, 775, 401, 211, 100, }, }, + /* 50*/ { TU("12345678901234567890123456789012345678901234"), 16, { 902, 491, 81, 137, 450, 302, 67, 15, 174, 492, 862, 667, 475, 869, 12, 434, }, }, + /* 51*/ { TU("99999999999999999999999999999999999999999999"), 16, { 902, 874, 223, 532, 264, 888, 236, 358, 185, 93, 795, 72, 289, 146, 822, 199, }, }, + }; + int data_size = ARRAY_SIZE(data); + int i, length; + + int chainemc[32]; + int mclength; + + testStart("test_numbprocess"); + + for (i = 0; i < data_size; i++) { + int j; + + if (index != -1 && i != index) continue; + + mclength = 0; + length = (int) ustrlen(data[i].chaine); + pdf_numbprocess_test(chainemc, &mclength, data[i].chaine, 0, length); + assert_nonzero(mclength < ARRAY_SIZE(chainemc), "i:%d mclength %d >= ARRAY_SIZE(chainemc) %d\n", i, mclength, ARRAY_SIZE(chainemc)); +#if 0 + for (j = 0; j < mclength; j++) { printf(" %d", chainemc[j]); } printf("\n"); +#endif + assert_equal(mclength, data[i].expected_len, "i:%d mclength %d != expected_len %d\n", i, mclength, data[i].expected_len); + for (j = 0; j < mclength; j++) { + assert_equal(chainemc[j], data[i].expected[j], "i:%d chainemc[%d] %d != %d\n", i, j, chainemc[j], data[i].expected[j]); + } + if (length < 20) { + char buf1[64], buf2[64]; + assert_zero(annex_d_decode_dump(chainemc, mclength, data[i].chaine, length, buf1, buf2), "i:%d annex_d_decode_dump() fail\n", i); + assert_zero(strcmp(buf1, buf2), "i:%d, strcmp(%s, %s) != 0\n", i, buf1, buf2); + } + } + + testFinish(); +} + #include #define TEST_PERF_ITER_MILLES 5 #define TEST_PERF_ITERATIONS (TEST_PERF_ITER_MILLES * 1000) #define TEST_PERF_TIME(arg) (((arg) * 1000.0) / CLOCKS_PER_SEC) -// Not a real test, just performance indicator +/* Not a real test, just performance indicator */ static void test_perf(int index, int debug) { struct item { @@ -2425,7 +3030,7 @@ static void test_perf(int index, int debug) { "HIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567" "890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcde" "fghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO", - 0, 40, 307, "960 chars, text/numeric" }, + 0, 43, 290, "960 chars, text/numeric" }, /* 2*/ { BARCODE_PDF417, DATA_MODE, -1, -1, "\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240" "\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240" @@ -2503,7 +3108,7 @@ static void test_perf(int index, int debug) { ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/); diff_buf_inter += clock() - start; assert_zero(ret, "i:%d ZBarcode_Buffer OUT_BUFFER_INTERMEDIATE ret %d != 0 (%s)\n", i, ret, symbol->errtxt); - symbol->output_options &= ~OUT_BUFFER_INTERMEDIATE; // Undo + symbol->output_options &= ~OUT_BUFFER_INTERMEDIATE; /* Undo */ start = clock(); ret = ZBarcode_Print(symbol, 0 /*rotate_angle*/); @@ -2539,6 +3144,7 @@ int main(int argc, char *argv[]) { { "test_encode", test_encode, 1, 1, 1 }, { "test_encode_segs", test_encode_segs, 1, 1, 1 }, { "test_fuzz", test_fuzz, 1, 0, 1 }, + { "test_numbprocess", test_numbprocess, 1, 0, 0 }, { "test_perf", test_perf, 1, 0, 1 }, }; diff --git a/backend/tests/test_png.c b/backend/tests/test_png.c index 18ab23f2..d1886ce4 100644 --- a/backend/tests/test_png.c +++ b/backend/tests/test_png.c @@ -44,7 +44,7 @@ static void test_pixel_plot(int index, int debug) { int repeat; int ret; }; - // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { /* 0*/ { 1, 1, "1", 0, 0 }, /* 1*/ { 2, 1, "11", 0, 0 }, @@ -352,14 +352,14 @@ static void test_wpng_error_handler(void) { wpng_error.symbol = &symbol; - // Create empty file - (void) remove(filename); // In case junk hanging around + /* Create empty file */ + (void) remove(filename); /* In case junk hanging around */ fp = fopen(filename, "w+"); assert_nonnull(fp, "fopen(%s) failed\n", filename); ret = fclose(fp); assert_zero(ret, "fclose(%s) %d != 0\n", filename, ret); - // Re-open for read, which will cause libpng to error + /* Re-open for read, which will cause libpng to error */ fp = fopen(filename, "r"); assert_nonnull(fp, "fopen(%s) for read failed\n", filename); @@ -378,7 +378,7 @@ static void test_wpng_error_handler(void) { } else { png_init_io(png_ptr, fp); - // This should fail and jmp to setjmp + /* This should fail and jmp to setjmp */ png_write_info(png_ptr, info_ptr); assert_zero(1, "libpng error setjmp failed\n"); } @@ -386,7 +386,7 @@ static void test_wpng_error_handler(void) { testFinish(); } -// Check compliant height printable for max CODABLOCKF with 44 rows * ((62 cols) * 0.55 + 3)) = 1632.4 +/* Check compliant height printable for max CODABLOCKF with 44 rows * ((62 cols) * 0.55 + 3)) = 1632.4 */ static void test_large_compliant_height(void) { int ret; struct zint_symbol *symbol = NULL; diff --git a/backend/tests/test_raster.c b/backend/tests/test_raster.c index a2f0bde0..62b1c853 100644 --- a/backend/tests/test_raster.c +++ b/backend/tests/test_raster.c @@ -1128,48 +1128,48 @@ static void test_scale(int index, int debug) { /* 6*/ { BARCODE_PHARMA_TWO, -1, -1, -1, 0, 0, "1234", "", 0, 10, 2, 13, 26, 20, 0 /*set_row*/, 20, 20, 2 }, /* With no scaling */ /* 7*/ { BARCODE_PHARMA_TWO, -1, -1, -1, 0, 3, "1234", "", 0, 10, 2, 13, 26 * 3, 20 * 3, 0 /*set_row*/, 20 * 3, 20 * 3, 2 * 3 }, /* 8*/ { BARCODE_PHARMA_TWO, -1, -1, -1, 13, 3, "1234", "", 0, 13, 2, 13, 26 * 3, 78, 0 /*set_row*/, 78, 20 * 3, 2 * 3 }, /* Height specified */ - /* 9*/ { BARCODE_PDF417, -1, -1, -1, 0, 0, "1", "", 0, 18, 6, 103, 206, 36, 0 /*set_row*/, 36, 170, 14 }, /* With no scaling */ - /* 10*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.6, "1", "", 0, 18, 6, 103, 206 * 0.6, 36 * 0.6, 0 /*set_row*/, 36 * 0.6, 170 * 0.6 + 1, 14 * 0.6 }, /* +1 set_col due to some scaling inversion difference */ - /* 11*/ { BARCODE_PDF417, -1, -1, -1, 0, 1.2, "1", "", 0, 18, 6, 103, 206 * 1.2, 36 * 1.2, 0 /*set_row*/, 36 * 1.2, 170 * 1.2 + 1, 14 * 1.2 }, /* +1 set_col due to some scaling inversion difference */ - /* 12*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.5, "1", "", 0, 18, 6, 103, 206 * 0.5, 36 * 0.5, 0 /*set_row*/, 36 * 0.5, 170 * 0.5, 14 * 0.5 }, - /* 13*/ { BARCODE_PDF417, -1, -1, -1, 0, 1.0, "1", "", 0, 18, 6, 103, 206 * 1.0, 36 * 1.0, 0 /*set_row*/, 36 * 1.0, 170 * 1.0, 14 * 1.0 }, - /* 14*/ { BARCODE_PDF417, -1, -1, -1, 0, 1.5, "1", "", 0, 18, 6, 103, 206 * 1.5, 36 * 1.5, 0 /*set_row*/, 36 * 1.5, 170 * 1.5, 14 * 1.5 }, - /* 15*/ { BARCODE_PDF417, -1, -1, -1, 0, 2.0, "1", "", 0, 18, 6, 103, 206 * 2.0, 36 * 2.0, 0 /*set_row*/, 36 * 2.0, 170 * 2.0, 14 * 2.0 }, - /* 16*/ { BARCODE_PDF417, -1, -1, -1, 0, 2.5, "1", "", 0, 18, 6, 103, 206 * 2.5, 36 * 2.5, 0 /*set_row*/, 36 * 2.5, 170 * 2.5, 14 * 2.5 }, - /* 17*/ { BARCODE_PDF417, -1, -1, -1, 0, 3.0, "1", "", 0, 18, 6, 103, 206 * 3.0, 36 * 3.0, 0 /*set_row*/, 36 * 3.0, 170 * 3.0, 14 * 3.0 }, - /* 18*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 0, "1", "", 0, 18, 6, 103, 218, 48, 0 /*set_row*/, 48, 176, 14 }, /* With no scaling */ - /* 19*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 0.6, "1", "", 0, 18, 6, 103, 218 * 0.6, 48 * 0.6, 0 /*set_row*/, 48 * 0.6, 176 * 0.6 + 1, 14 * 0.6 }, /* +1 set_col due to some scaling inversion difference */ - /* 20*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 1.6, "1", "", 0, 18, 6, 103, 218 * 1.6, 48 * 1.6, 0 /*set_row*/, 48 * 1.6, 176 * 1.6 + 1, 14 * 1.6 }, /* +1 set_col due to some scaling inversion difference */ - /* 21*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 1.5, "1", "", 0, 18, 6, 103, 218 * 1.5, 48 * 1.5, 0 /*set_row*/, 48 * 1.5, 176 * 1.5, 14 * 1.5 }, - /* 22*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 2.5, "1", "", 0, 18, 6, 103, 218 * 2.5, 48 * 2.5, 0 /*set_row*/, 48 * 2.5, 176 * 2.5, 14 * 2.5 }, - /* 23*/ { BARCODE_PDF417, -1, 3, OUT_BUFFER_INTERMEDIATE, 0, 1.3, "1", "", 0, 18, 6, 103, 206 * 1.3, 36 * 1.3, 0 /*set_row*/, 36 * 1.3, 170 * 1.3, 14 * 1.3 }, - /* 24*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.5, "1", "", 0, 18, 6, 103, 206 * 0.5, 36 * 0.5, 0 /*set_row*/, 36 * 0.5, 170 * 0.5, 14 * 0.5 }, - /* 25*/ { BARCODE_PDF417, -1, -1, -1, 1, 0.5, "1", "", 0, 6, 6, 103, 206 * 0.5, 6, 0 /*set_row*/, 6, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 26*/ { BARCODE_PDF417, -1, -1, -1, 5, 0.5, "1", "", 0, 6, 6, 103, 206 * 0.5, 6, 0 /*set_row*/, 6, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 27*/ { BARCODE_PDF417, -1, -1, -1, 6, 0.5, "1", "", 0, 6, 6, 103, 206 * 0.5, 6, 0 /*set_row*/, 6, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 28*/ { BARCODE_PDF417, -1, -1, -1, 7, 0.5, "1", "", 0, 6, 6, 103, 206 * 0.5, 6, 0 /*set_row*/, 6, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 29*/ { BARCODE_PDF417, -1, -1, -1, 8, 0.5, "1", "", 0, 6, 6, 103, 206 * 0.5, 6, 0 /*set_row*/, 6, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 30*/ { BARCODE_PDF417, -1, -1, -1, 9, 0.5, "1", "", 0, 12, 6, 103, 206 * 0.5, 12, 0 /*set_row*/, 12, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 31*/ { BARCODE_PDF417, -1, -1, -1, 10, 0.5, "1", "", 0, 12, 6, 103, 206 * 0.5, 12, 0 /*set_row*/, 12, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 32*/ { BARCODE_PDF417, -1, -1, -1, 11, 0.5, "1", "", 0, 12, 6, 103, 206 * 0.5, 12, 0 /*set_row*/, 12, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 33*/ { BARCODE_PDF417, -1, -1, -1, 12, 0.5, "1", "", 0, 12, 6, 103, 206 * 0.5, 12, 0 /*set_row*/, 12, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 34*/ { BARCODE_PDF417, -1, -1, -1, 13, 0.5, "1", "", 0, 12, 6, 103, 206 * 0.5, 12, 0 /*set_row*/, 12, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 35*/ { BARCODE_PDF417, -1, -1, -1, 14, 0.5, "1", "", 0, 12, 6, 103, 206 * 0.5, 12, 0 /*set_row*/, 12, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 36*/ { BARCODE_PDF417, -1, -1, -1, 15, 0.5, "1", "", 0, 18, 6, 103, 206 * 0.5, 18, 0 /*set_row*/, 18, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 37*/ { BARCODE_PDF417, -1, -1, -1, 16, 0.5, "1", "", 0, 18, 6, 103, 206 * 0.5, 18, 0 /*set_row*/, 18, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 38*/ { BARCODE_PDF417, -1, -1, -1, 17, 0.5, "1", "", 0, 18, 6, 103, 206 * 0.5, 18, 0 /*set_row*/, 18, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 39*/ { BARCODE_PDF417, -1, -1, -1, 18, 0.5, "1", "", 0, 18, 6, 103, 206 * 0.5, 18, 0 /*set_row*/, 18, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 40*/ { BARCODE_PDF417, -1, -1, -1, 19, 0.5, "1", "", 0, 18, 6, 103, 206 * 0.5, 18, 0 /*set_row*/, 18, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 41*/ { BARCODE_PDF417, -1, -1, -1, 20, 0.5, "1", "", 0, 18, 6, 103, 206 * 0.5, 18, 0 /*set_row*/, 18, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 42*/ { BARCODE_PDF417, -1, -1, -1, 21, 0.5, "1", "", 0, 24, 6, 103, 206 * 0.5, 24, 0 /*set_row*/, 24, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 43*/ { BARCODE_PDF417, -1, -1, -1, 38, 0.5, "1", "", 0, 36, 6, 103, 206 * 0.5, 36, 0 /*set_row*/, 36, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 44*/ { BARCODE_PDF417, -1, -1, -1, 39, 0.5, "1", "", 0, 42, 6, 103, 206 * 0.5, 42, 0 /*set_row*/, 42, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 45*/ { BARCODE_PDF417, -1, -1, -1, 40, 0.5, "1", "", 0, 42, 6, 103, 206 * 0.5, 42, 0 /*set_row*/, 42, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 46*/ { BARCODE_PDF417, -1, -1, -1, 41, 0.5, "1", "", 0, 42, 6, 103, 206 * 0.5, 42, 0 /*set_row*/, 42, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 47*/ { BARCODE_PDF417, -1, -1, -1, 42, 0.5, "1", "", 0, 42, 6, 103, 206 * 0.5, 42, 0 /*set_row*/, 42, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 48*/ { BARCODE_PDF417, -1, -1, -1, 43, 0.5, "1", "", 0, 42, 6, 103, 206 * 0.5, 42, 0 /*set_row*/, 42, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 49*/ { BARCODE_PDF417, -1, -1, -1, 44, 0.5, "1", "", 0, 42, 6, 103, 206 * 0.5, 42, 0 /*set_row*/, 42, 170 * 0.5, 14 * 0.5 }, /* Height specified */ - /* 50*/ { BARCODE_PDF417, -1, -1, -1, 45, 0.5, "1", "", 0, 48, 6, 103, 206 * 0.5, 48, 0 /*set_row*/, 48, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 9*/ { BARCODE_PDF417, -1, -1, -1, 0, 0, "1", "", 0, 15, 5, 103, 206, 30, 0 /*set_row*/, 30, 170, 14 }, /* With no scaling */ + /* 10*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.6, "1", "", 0, 15, 5, 103, 206 * 0.6, 30 * 0.6, 0 /*set_row*/, 30 * 0.6, 170 * 0.6 + 1, 14 * 0.6 }, /* +1 set_col due to some scaling inversion difference */ + /* 11*/ { BARCODE_PDF417, -1, -1, -1, 0, 1.2, "1", "", 0, 15, 5, 103, 206 * 1.2, 30 * 1.2, 0 /*set_row*/, 30 * 1.2, 170 * 1.2 + 1, 14 * 1.2 }, /* +1 set_col due to some scaling inversion difference */ + /* 12*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.5, "1", "", 0, 15, 5, 103, 206 * 0.5, 30 * 0.5, 0 /*set_row*/, 30 * 0.5, 170 * 0.5, 14 * 0.5 }, + /* 13*/ { BARCODE_PDF417, -1, -1, -1, 0, 1.0, "1", "", 0, 15, 5, 103, 206 * 1.0, 30 * 1.0, 0 /*set_row*/, 30 * 1.0, 170 * 1.0, 14 * 1.0 }, + /* 14*/ { BARCODE_PDF417, -1, -1, -1, 0, 1.5, "1", "", 0, 15, 5, 103, 206 * 1.5, 30 * 1.5, 0 /*set_row*/, 30 * 1.5, 170 * 1.5, 14 * 1.5 }, + /* 15*/ { BARCODE_PDF417, -1, -1, -1, 0, 2.0, "1", "", 0, 15, 5, 103, 206 * 2.0, 30 * 2.0, 0 /*set_row*/, 30 * 2.0, 170 * 2.0, 14 * 2.0 }, + /* 16*/ { BARCODE_PDF417, -1, -1, -1, 0, 2.5, "1", "", 0, 15, 5, 103, 206 * 2.5, 30 * 2.5, 0 /*set_row*/, 30 * 2.5, 170 * 2.5, 14 * 2.5 }, + /* 17*/ { BARCODE_PDF417, -1, -1, -1, 0, 3.0, "1", "", 0, 15, 5, 103, 206 * 3.0, 30 * 3.0, 0 /*set_row*/, 30 * 3.0, 170 * 3.0, 14 * 3.0 }, + /* 18*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 0, "1", "", 0, 15, 5, 103, 218, 42, 0 /*set_row*/, 42, 176, 14 }, /* With no scaling */ + /* 19*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 0.6, "1", "", 0, 15, 5, 103, 218 * 0.6, 42 * 0.6, 0 /*set_row*/, 42 * 0.6, 176 * 0.6 + 1, 14 * 0.6 }, /* +1 set_col due to some scaling inversion difference */ + /* 20*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 1.6, "1", "", 0, 15, 5, 103, 218 * 1.6, 42 * 1.6, 0 /*set_row*/, 42 * 1.6, 176 * 1.6 + 1, 14 * 1.6 }, /* +1 set_col due to some scaling inversion difference */ + /* 21*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 1.5, "1", "", 0, 15, 5, 103, 218 * 1.5, 42 * 1.5, 0 /*set_row*/, 42 * 1.5, 176 * 1.5, 14 * 1.5 }, + /* 22*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, 2.5, "1", "", 0, 15, 5, 103, 218 * 2.5, 42 * 2.5, 0 /*set_row*/, 42 * 2.5, 176 * 2.5, 14 * 2.5 }, + /* 23*/ { BARCODE_PDF417, -1, 3, OUT_BUFFER_INTERMEDIATE, 0, 1.3, "1", "", 0, 15, 5, 103, 206 * 1.3, 30 * 1.3, 0 /*set_row*/, 30 * 1.3, 170 * 1.3, 14 * 1.3 }, + /* 24*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.5, "1", "", 0, 15, 5, 103, 206 * 0.5, 30 * 0.5, 0 /*set_row*/, 30 * 0.5, 170 * 0.5, 14 * 0.5 }, + /* 25*/ { BARCODE_PDF417, -1, -1, -1, 1, 0.5, "1", "", 0, 5, 5, 103, 206 * 0.5, 5, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 26*/ { BARCODE_PDF417, -1, -1, -1, 5, 0.5, "1", "", 0, 5, 5, 103, 206 * 0.5, 5, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 27*/ { BARCODE_PDF417, -1, -1, -1, 6, 0.5, "1", "", 0, 5, 5, 103, 206 * 0.5, 5, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 28*/ { BARCODE_PDF417, -1, -1, -1, 7, 0.5, "1", "", 0, 5, 5, 103, 206 * 0.5, 5, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 29*/ { BARCODE_PDF417, -1, -1, -1, 8, 0.5, "1", "", 0, 10, 5, 103, 206 * 0.5, 10, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 30*/ { BARCODE_PDF417, -1, -1, -1, 9, 0.5, "1", "", 0, 10, 5, 103, 206 * 0.5, 10, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 31*/ { BARCODE_PDF417, -1, -1, -1, 10, 0.5, "1", "", 0, 10, 5, 103, 206 * 0.5, 10, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 32*/ { BARCODE_PDF417, -1, -1, -1, 11, 0.5, "1", "", 0, 10, 5, 103, 206 * 0.5, 10, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 33*/ { BARCODE_PDF417, -1, -1, -1, 12, 0.5, "1", "", 0, 10, 5, 103, 206 * 0.5, 10, 0 /*set_row*/, 5, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 34*/ { BARCODE_PDF417, -1, -1, -1, 13, 0.5, "1", "", 0, 15, 5, 103, 206 * 0.5, 15, 0 /*set_row*/, 15, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 35*/ { BARCODE_PDF417, -1, -1, -1, 14, 0.5, "1", "", 0, 15, 5, 103, 206 * 0.5, 15, 0 /*set_row*/, 15, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 36*/ { BARCODE_PDF417, -1, -1, -1, 15, 0.5, "1", "", 0, 15, 5, 103, 206 * 0.5, 15, 0 /*set_row*/, 15, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 37*/ { BARCODE_PDF417, -1, -1, -1, 16, 0.5, "1", "", 0, 15, 5, 103, 206 * 0.5, 15, 0 /*set_row*/, 15, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 38*/ { BARCODE_PDF417, -1, -1, -1, 17, 0.5, "1", "", 0, 15, 5, 103, 206 * 0.5, 15, 0 /*set_row*/, 15, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 39*/ { BARCODE_PDF417, -1, -1, -1, 18, 0.5, "1", "", 0, 20, 5, 103, 206 * 0.5, 20, 0 /*set_row*/, 20, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 40*/ { BARCODE_PDF417, -1, -1, -1, 19, 0.5, "1", "", 0, 20, 5, 103, 206 * 0.5, 20, 0 /*set_row*/, 20, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 41*/ { BARCODE_PDF417, -1, -1, -1, 20, 0.5, "1", "", 0, 20, 5, 103, 206 * 0.5, 20, 0 /*set_row*/, 20, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 42*/ { BARCODE_PDF417, -1, -1, -1, 21, 0.5, "1", "", 0, 20, 5, 103, 206 * 0.5, 20, 0 /*set_row*/, 20, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 43*/ { BARCODE_PDF417, -1, -1, -1, 38, 0.5, "1", "", 0, 40, 5, 103, 206 * 0.5, 40, 0 /*set_row*/, 40, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 44*/ { BARCODE_PDF417, -1, -1, -1, 39, 0.5, "1", "", 0, 40, 5, 103, 206 * 0.5, 40, 0 /*set_row*/, 40, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 45*/ { BARCODE_PDF417, -1, -1, -1, 40, 0.5, "1", "", 0, 40, 5, 103, 206 * 0.5, 40, 0 /*set_row*/, 40, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 46*/ { BARCODE_PDF417, -1, -1, -1, 41, 0.5, "1", "", 0, 40, 5, 103, 206 * 0.5, 40, 0 /*set_row*/, 40, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 47*/ { BARCODE_PDF417, -1, -1, -1, 42, 0.5, "1", "", 0, 40, 5, 103, 206 * 0.5, 40, 0 /*set_row*/, 40, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 48*/ { BARCODE_PDF417, -1, -1, -1, 43, 0.5, "1", "", 0, 45, 5, 103, 206 * 0.5, 45, 0 /*set_row*/, 45, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 49*/ { BARCODE_PDF417, -1, -1, -1, 44, 0.5, "1", "", 0, 45, 5, 103, 206 * 0.5, 45, 0 /*set_row*/, 45, 170 * 0.5, 14 * 0.5 }, /* Height specified */ + /* 50*/ { BARCODE_PDF417, -1, -1, -1, 45, 0.5, "1", "", 0, 45, 5, 103, 206 * 0.5, 45, 0 /*set_row*/, 45, 170 * 0.5, 14 * 0.5 }, /* Height specified */ /* 51*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 0, 0, "123456789012", "", 0, 50, 1, 79, 158, 116, 104 /*set_row*/, 114, 20, 2 }, /* With no scaling */ /* 52*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 0, 1.5, "123456789012", "", 0, 50, 1, 79, 158 * 1.5, 116 * 1.5, 104 * 1.5 /*set_row*/, 114 * 1.5, 20 * 1.5, 1 * 1.5 }, /* 53*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 0, 2.0, "123456789012", "", 0, 50, 1, 79, 158 * 2.0, 116 * 2.0, 104 * 2.0 /*set_row*/, 114 * 2.0, 20 * 2.0, 1 * 2.0 }, @@ -1788,56 +1788,59 @@ static void test_buffer_plot(int index, int generate, int debug) { char *expected_bitmap; }; struct item data[] = { - /* 0*/ { BARCODE_PDF417, 0, 1, -1, -1, 15, "", "", "1", 0, 15, 5, 86, 86, 15, - "11111111010101000111101010111100001110101001110000011101010111000000111111101000101001" - "11111111010101000111101010111100001110101001110000011101010111000000111111101000101001" - "11111111010101000111101010111100001110101001110000011101010111000000111111101000101001" - "11111111010101000111111010101110001011111101001100011111101010111000111111101000101001" - "11111111010101000111111010101110001011111101001100011111101010111000111111101000101001" - "11111111010101000111111010101110001011111101001100011111101010111000111111101000101001" - "11111111010101000110101011111000001111110101101000011101010111111000111111101000101001" - "11111111010101000110101011111000001111110101101000011101010111111000111111101000101001" - "11111111010101000110101011111000001111110101101000011101010111111000111111101000101001" - "11111111010101000101011110011110001110111101100100011010111101111100111111101000101001" - "11111111010101000101011110011110001110111101100100011010111101111100111111101000101001" - "11111111010101000101011110011110001110111101100100011010111101111100111111101000101001" - "11111111010101000111010111001100001110100111000110011101011100110000111111101000101001" - "11111111010101000111010111001100001110100111000110011101011100110000111111101000101001" - "11111111010101000111010111001100001110100111000110011101011100110000111111101000101001" + /* 0*/ { BARCODE_PDF417, 0, 1, -1, -1, 15, "", "", "1", 0, 16, 4, 86, 86, 16, + "11111111010101000111101010111100001111101010111110011101010111000000111111101000101001" + "11111111010101000111101010111100001111101010111110011101010111000000111111101000101001" + "11111111010101000111101010111100001111101010111110011101010111000000111111101000101001" + "11111111010101000111101010111100001111101010111110011101010111000000111111101000101001" + "11111111010101000111110101011000001111000001000101011111101010111000111111101000101001" + "11111111010101000111110101011000001111000001000101011111101010111000111111101000101001" + "11111111010101000111110101011000001111000001000101011111101010111000111111101000101001" + "11111111010101000111110101011000001111000001000101011111101010111000111111101000101001" + "11111111010101000110101011111000001111011111101011011010101111100000111111101000101001" + "11111111010101000110101011111000001111011111101011011010101111100000111111101000101001" + "11111111010101000110101011111000001111011111101011011010101111100000111111101000101001" + "11111111010101000110101011111000001111011111101011011010101111100000111111101000101001" + "11111111010101000101011110011110001010000010001000011010111101111100111111101000101001" + "11111111010101000101011110011110001010000010001000011010111101111100111111101000101001" + "11111111010101000101011110011110001010000010001000011010111101111100111111101000101001" + "11111111010101000101011110011110001010000010001000011010111101111100111111101000101001" }, - /* 1*/ { BARCODE_PDF417, 0, 1, -1, -1, 15, "FF0000", "00FF0099", "1", 0, 15, 5, 86, 86, 15, - "RRRRRRRRGRGRGRGGGRRRRGRGRGRRRRGGGGRRRGRGRGGRRRGGGGGRRRGRGRGRRRGGGGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRRRGRGRGRRRRGGGGRRRGRGRGGRRRGGGGGRRRGRGRGRRRGGGGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRRRGRGRGRRRRGGGGRRRGRGRGGRRRGGGGGRRRGRGRGRRRGGGGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRRRRRGRGRGRRRGGGRGRRRRRRGRGGRRGGGRRRRRRGRGRGRRRGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRRRRRGRGRGRRRGGGRGRRRRRRGRGGRRGGGRRRRRRGRGRGRRRGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRRRRRGRGRGRRRGGGRGRRRRRRGRGGRRGGGRRRRRRGRGRGRRRGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRGRGRGRRRRRGGGGGRRRRRRGRGRRGRGGGGRRRGRGRGRRRRRRGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRGRGRGRRRRRGGGGGRRRRRRGRGRRGRGGGGRRRGRGRGRRRRRRGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRGRGRGRRRRRGGGGGRRRRRRGRGRRGRGGGGRRRGRGRGRRRRRRGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRGRGRRRRGGRRRRGGGRRRGRRRRGRRGGRGGGRRGRGRRRRGRRRRRGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRGRGRRRRGGRRRRGGGRRRGRRRRGRRGGRGGGRRGRGRRRRGRRRRRGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRGRGRRRRGGRRRRGGGRRRGRRRRGRRGGRGGGRRGRGRRRRGRRRRRGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRRGRGRRRGGRRGGGGRRRGRGGRRRGGGRRGGRRRGRGRRRGGRRGGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRRGRGRRRGGRRGGGGRRRGRGGRRRGGGRRGGRRRGRGRRRGGRRGGGGRRRRRRRGRGGGRGRGGR" - "RRRRRRRRGRGRGRGGGRRRGRGRRRGGRRGGGGRRRGRGGRRRGGGRRGGRRRGRGRRRGGRRGGGGRRRRRRRGRGGGRGRGGR" + /* 1*/ { BARCODE_PDF417, 0, 1, -1, -1, 15, "FF0000", "00FF0099", "1", 0, 16, 4, 86, 86, 16, + "RRRRRRRRGRGRGRGGGRRRRGRGRGRRRRGGGGRRRRRGRGRGRRRRRGGRRRGRGRGRRRGGGGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRRRGRGRGRRRRGGGGRRRRRGRGRGRRRRRGGRRRGRGRGRRRGGGGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRRRGRGRGRRRRGGGGRRRRRGRGRGRRRRRGGRRRGRGRGRRRGGGGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRRRGRGRGRRRRGGGGRRRRRGRGRGRRRRRGGRRRGRGRGRRRGGGGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRRRRGRGRGRRGGGGGRRRRGGGGGRGGGRGRGRRRRRRGRGRGRRRGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRRRRGRGRGRRGGGGGRRRRGGGGGRGGGRGRGRRRRRRGRGRGRRRGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRRRRGRGRGRRGGGGGRRRRGGGGGRGGGRGRGRRRRRRGRGRGRRRGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRRRRGRGRGRRGGGGGRRRRGGGGGRGGGRGRGRRRRRRGRGRGRRRGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRGRGRGRRRRRGGGGGRRRRGRRRRRRGRGRRGRRGRGRGRRRRRGGGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRGRGRGRRRRRGGGGGRRRRGRRRRRRGRGRRGRRGRGRGRRRRRGGGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRGRGRGRRRRRGGGGGRRRRGRRRRRRGRGRRGRRGRGRGRRRRRGGGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRRGRGRGRRRRRGGGGGRRRRGRRRRRRGRGRRGRRGRGRGRRRRRGGGGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRGRGRRRRGGRRRRGGGRGRGGGGGRGGGRGGGGRRGRGRRRRGRRRRRGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRGRGRRRRGGRRRRGGGRGRGGGGGRGGGRGGGGRRGRGRRRRGRRRRRGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRGRGRRRRGGRRRRGGGRGRGGGGGRGGGRGGGGRRGRGRRRRGRRRRRGGRRRRRRRGRGGGRGRGGR" + "RRRRRRRRGRGRGRGGGRGRGRRRRGGRRRRGGGRGRGGGGGRGGGRGGGGRRGRGRRRRGRRRRRGGRRRRRRRGRGGGRGRGGR" }, - /* 2*/ { BARCODE_PDF417, 0, 1, 1, -1, 15, "FFFF0033", "00FF00", "1", 0, 15, 5, 86, 88, 15, - "GYYYYYYYYGYGYGYGGGYYYYGYGYGYYYYGGGGYYYGYGYGGYYYGGGGGYYYGYGYGYYYGGGGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYYYGYGYGYYYYGGGGYYYGYGYGGYYYGGGGGYYYGYGYGYYYGGGGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYYYGYGYGYYYYGGGGYYYGYGYGGYYYGGGGGYYYGYGYGYYYGGGGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYYYYYGYGYGYYYGGGYGYYYYYYGYGGYYGGGYYYYYYGYGYGYYYGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYYYYYGYGYGYYYGGGYGYYYYYYGYGGYYGGGYYYYYYGYGYGYYYGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYYYYYGYGYGYYYGGGYGYYYYYYGYGGYYGGGYYYYYYGYGYGYYYGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYGYGYGYYYYYGGGGGYYYYYYGYGYYGYGGGGYYYGYGYGYYYYYYGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYGYGYGYYYYYGGGGGYYYYYYGYGYYGYGGGGYYYGYGYGYYYYYYGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYGYGYGYYYYYGGGGGYYYYYYGYGYYGYGGGGYYYGYGYGYYYYYYGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYGYGYYYYGGYYYYGGGYYYGYYYYGYYGGYGGGYYGYGYYYYGYYYYYGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYGYGYYYYGGYYYYGGGYYYGYYYYGYYGGYGGGYYGYGYYYYGYYYYYGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYGYGYYYYGGYYYYGGGYYYGYYYYGYYGGYGGGYYGYGYYYYGYYYYYGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYYGYGYYYGGYYGGGGYYYGYGGYYYGGGYYGGYYYGYGYYYGGYYGGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYYGYGYYYGGYYGGGGYYYGYGGYYYGGGYYGGYYYGYGYYYGGYYGGGGYYYYYYYGYGGGYGYGGYG" - "GYYYYYYYYGYGYGYGGGYYYGYGYYYGGYYGGGGYYYGYGGYYYGGGYYGGYYYGYGYYYGGYYGGGGYYYYYYYGYGGGYGYGGYG" + /* 2*/ { BARCODE_PDF417, 0, 1, 1, -1, 15, "FFFF0033", "00FF00", "1", 0, 16, 4, 86, 88, 16, + "GYYYYYYYYGYGYGYGGGYYYYGYGYGYYYYGGGGYYYYYGYGYGYYYYYGGYYYGYGYGYYYGGGGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYYYGYGYGYYYYGGGGYYYYYGYGYGYYYYYGGYYYGYGYGYYYGGGGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYYYGYGYGYYYYGGGGYYYYYGYGYGYYYYYGGYYYGYGYGYYYGGGGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYYYGYGYGYYYYGGGGYYYYYGYGYGYYYYYGGYYYGYGYGYYYGGGGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYYYYGYGYGYYGGGGGYYYYGGGGGYGGGYGYGYYYYYYGYGYGYYYGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYYYYGYGYGYYGGGGGYYYYGGGGGYGGGYGYGYYYYYYGYGYGYYYGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYYYYGYGYGYYGGGGGYYYYGGGGGYGGGYGYGYYYYYYGYGYGYYYGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYYYYGYGYGYYGGGGGYYYYGGGGGYGGGYGYGYYYYYYGYGYGYYYGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYGYGYGYYYYYGGGGGYYYYGYYYYYYGYGYYGYYGYGYGYYYYYGGGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYGYGYGYYYYYGGGGGYYYYGYYYYYYGYGYYGYYGYGYGYYYYYGGGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYGYGYGYYYYYGGGGGYYYYGYYYYYYGYGYYGYYGYGYGYYYYYGGGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYYGYGYGYYYYYGGGGGYYYYGYYYYYYGYGYYGYYGYGYGYYYYYGGGGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYGYGYYYYGGYYYYGGGYGYGGGGGYGGGYGGGGYYGYGYYYYGYYYYYGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYGYGYYYYGGYYYYGGGYGYGGGGGYGGGYGGGGYYGYGYYYYGYYYYYGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYGYGYYYYGGYYYYGGGYGYGGGGGYGGGYGGGGYYGYGYYYYGYYYYYGGYYYYYYYGYGGGYGYGGYG" + "GYYYYYYYYGYGYGYGGGYGYGYYYYGGYYYYGGGYGYGGGGGYGGGYGGGGYYGYGYYYYGYYYYYGGYYYYYYYGYGGGYGYGGYG" }, /* 3*/ { BARCODE_ULTRA, -1, -1, -1, -1, 13, "FF00007F", "00FF0000", "1", 0, 13, 13, 13, 13, 13, "1111111111111" diff --git a/backend/tests/test_vector.c b/backend/tests/test_vector.c index ff4ea4b2..86bdd9ce 100644 --- a/backend/tests/test_vector.c +++ b/backend/tests/test_vector.c @@ -905,10 +905,10 @@ static void test_scale(int index, int debug) { }; /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { - /* 0*/ { BARCODE_PDF417, -1, -1, -1, 0, 0, "1", "", 0, 18, 6, 103, 206, 36, 1, 52, 0, 8, 6 }, /* With no scaling */ - /* 1*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.1, "1", "", 0, 18, 6, 103, 206 * 0.1, 3.6000001, 1, 5.2000003, 0, 8 * 0.1, 6 * 0.1 }, - /* 2*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.3, "1", "", 0, 18, 6, 103, 61.8000031, 36 * 0.3, 1, 52 * 0.3, 0, 2.4000001, 1.8000001 }, - /* 3*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.6, "1", "", 0, 18, 6, 103, 123.600006, 36 * 0.6, 1, 52 * 0.6, 0, 4.8000002, 3.6000001 }, + /* 0*/ { BARCODE_PDF417, -1, -1, -1, 0, 0, "1", "", 0, 15, 5, 103, 206, 30, 1, 52, 0, 8, 6 }, /* With no scaling */ + /* 1*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.1, "1", "", 0, 15, 5, 103, 206 * 0.1, 3, 1, 5.2000003, 0, 8 * 0.1, 6 * 0.1 }, + /* 2*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.3, "1", "", 0, 15, 5, 103, 61.8000031, 30 * 0.3, 1, 52 * 0.3, 0, 2.4000001, 1.8000001 }, + /* 3*/ { BARCODE_PDF417, -1, -1, -1, 0, 0.6, "1", "", 0, 15, 5, 103, 123.600006, 30 * 0.6, 1, 52 * 0.6, 0, 4.8000002, 3.6000001 }, /* 4*/ { BARCODE_UPCE_CC, -1, -1, -1, 0, 0, "1234567", "[17]010615[10]A123456\"", 0, 50, 10, 55, 142, 116.400002, 1, 34, 36, 2, 64 }, /* With no scaling */ /* 5*/ { BARCODE_UPCE_CC, -1, -1, -1, 0, 0.1, "1234567", "[17]010615[10]A123456\"", 0, 50, 10, 55, 142 * 0.1, 11.6400003, 1, 34 * 0.1, 3.6000001, 2 * 0.1, 64 * 0.1 }, /* 6*/ { BARCODE_UPCE_CC, -1, -1, -1, 0.1, 0.1, "1234567", "[17]010615[10]A123456\"", 0, 18.5, 10, 55, 142 * 0.1, 5.34000015, 1, 34 * 0.1, 3.6000001, 2 * 0.1, 0.1 }, /* Height specified */ diff --git a/backend/tests/tools/run_bwipp_tests.sh b/backend/tests/tools/run_bwipp_tests.sh index d5d67710..9682aad5 100755 --- a/backend/tests/tools/run_bwipp_tests.sh +++ b/backend/tests/tools/run_bwipp_tests.sh @@ -39,6 +39,7 @@ run_bwipp_test "test_maxicode" "input" run_bwipp_test "test_maxicode" "encode" run_bwipp_test "test_maxicode" "encode_segs" run_bwipp_test "test_medical" "encode" +run_bwipp_test "test_pdf417" "input" run_bwipp_test "test_pdf417" "encode" run_bwipp_test "test_pdf417" "encode_segs" run_bwipp_test "test_plessey" "encode" diff --git a/backend/tests/tools/run_zxingcpp_tests.sh b/backend/tests/tools/run_zxingcpp_tests.sh index 14ba16d8..c1429c8f 100755 --- a/backend/tests/tools/run_zxingcpp_tests.sh +++ b/backend/tests/tools/run_zxingcpp_tests.sh @@ -31,6 +31,8 @@ run_zxingcpp_test "test_maxicode" "input" run_zxingcpp_test "test_maxicode" "encode" run_zxingcpp_test "test_maxicode" "encode_segs" run_zxingcpp_test "test_medical" "encode" +run_zxingcpp_test "test_pdf417" "reader_init" +run_zxingcpp_test "test_pdf417" "input" run_zxingcpp_test "test_pdf417" "encode" run_zxingcpp_test "test_pdf417" "encode_segs" run_zxingcpp_test "test_qr" diff --git a/docs/images/bc412.svg b/docs/images/bc412.svg new file mode 100644 index 00000000..440d1a8e --- /dev/null +++ b/docs/images/bc412.svg @@ -0,0 +1,51 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AQQ45670 + + + diff --git a/docs/images/codablockf.svg b/docs/images/codablockf.svg index 91cbcc49..a302a3fa 100644 --- a/docs/images/codablockf.svg +++ b/docs/images/codablockf.svg @@ -11,89 +11,109 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/code16k.svg b/docs/images/code16k.svg index c45fea36..c86e81f6 100644 --- a/docs/images/code16k.svg +++ b/docs/images/code16k.svg @@ -8,40 +8,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/code49.svg b/docs/images/code49.svg index b8044f51..bfdabac8 100644 --- a/docs/images/code49.svg +++ b/docs/images/code49.svg @@ -8,81 +8,96 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/manual.txt b/docs/manual.txt index a0aad1d2..f6e1680d 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -4241,7 +4241,7 @@ OPTIONS Set the ECI code for the input data to INTEGER. See -e | --ecinos for a list of the ECIs available. ECIs are supported by Aztec Code, Code One, Data Matrix, DotCode, Grid Matrix, Han Xin Code, MaxiCode, MicroPDF417, PDF417, - QR Code, rMQR and Ultracode + QR Code, rMQR and Ultracode. --esc diff --git a/docs/zint.1 b/docs/zint.1 index 4f583313..30a03547 100644 --- a/docs/zint.1 +++ b/docs/zint.1 @@ -158,7 +158,7 @@ Set the ECI code for the input data to \f[I]INTEGER\f[R]. See \f[V]-e\f[R] | \f[V]--ecinos\f[R] for a list of the ECIs available. ECIs are supported by Aztec Code, Code One, Data Matrix, DotCode, Grid Matrix, Han Xin Code, MaxiCode, MicroPDF417, PDF417, QR Code, rMQR and -Ultracode +Ultracode. .TP \f[V]--esc\f[R] Process escape characters in the input data. diff --git a/docs/zint.1.pmd b/docs/zint.1.pmd index 2e2a656d..8ecaf6b4 100644 --- a/docs/zint.1.pmd +++ b/docs/zint.1.pmd @@ -114,7 +114,7 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S : Set the ECI code for the input data to *INTEGER*. See `-e` | `--ecinos` for a list of the ECIs available. ECIs are supported by Aztec Code, Code One, Data Matrix, DotCode, Grid Matrix, Han Xin Code, MaxiCode, MicroPDF417, PDF417, - QR Code, rMQR and Ultracode + QR Code, rMQR and Ultracode. `--esc` diff --git a/frontend/tests/test_args.c b/frontend/tests/test_args.c index c7e68363..7acee653 100644 --- a/frontend/tests/test_args.c +++ b/frontend/tests/test_args.c @@ -313,7 +313,7 @@ static void test_dump_args(int index, int debug) { /* 14*/ { BARCODE_CODE11, NULL, NULL, "123", NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 1, "B2 D6 96 CA B5 64" }, /* 15*/ { BARCODE_CODE11, "123", NULL, "456", NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 2, "B2 D6 96 CA B2\nB2 B6 DA 9A B2" }, /* 16*/ { BARCODE_CODE11, "123", "456", "789", "012", -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 2, "B2 D6 96 CA B2\nB2 B6 DA 9A B2\nB2 A6 D2 D5 64\nB2 AD AD 2D 64" }, - /* 17*/ { BARCODE_PDF417, "123", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 0, 0, -1, "FF 54 7A BC 3D 4F 1D 5C 0F E8 A4\nFF 54 7A 90 2F D3 1F AB 8F E8 A4\nFF 54 6A F8 3A BF 15 3C 0F E8 A4\nFF 54 57 9E 24 E7 1A F7 CF E8 A4\nFF 54 7A E7 3D 0D 9D 73 0F E8 A4\nFF 54 7D 70 B9 CB DF 5E CF E8 A4" }, + /* 17*/ { BARCODE_PDF417, "123", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 0, 0, -1, "FF 54 7A BC 3A 9C 1D 5C 0F E8 A4\nFF 54 7E AE 3C 11 5F AB 8F E8 A4\nFF 54 6A F8 29 9F 1D 5F 8F E8 A4\nFF 54 57 9E 37 BA 1A F7 CF E8 A4\nFF 54 75 CC 36 F0 5D 73 0F E8 A4" }, /* 18*/ { BARCODE_DATAMATRIX, "ABC", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA 8\nB3 4\n8F 0\nB2 C\nA6 0\nBA C\nD6 0\nEB 4\nE2 8\nFF C" }, /* 19*/ { BARCODE_DATAMATRIX, "ABC", NULL, NULL, NULL, -1, READER_INIT, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A\nAC 7\n8A 4\nA0 3\nC2 2\nB5 1\n82 2\nBA 7\n8C C\nA0 5\n86 A\nFF F" }, /* 20*/ { BARCODE_DATAMATRIX, "ABCDEFGH", NULL, NULL, NULL, FAST_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nA6 8C\nB2 F0\n98 B4\nB9 A8\nB8 CC\nF0 78\nA0 3C\n99 70\n85 1C\nDA B0\nE5 94\nA7 50\nFF FC" },