ULTRA: enable compression for GS1_MODE; compression changes; fixes; tests

This commit is contained in:
gitlost 2020-04-09 22:08:54 +01:00
parent e86d9d1dc8
commit e04f662dc0
21 changed files with 762 additions and 46 deletions

View file

@ -477,4 +477,21 @@ void debug_test_codeword_dump(struct zint_symbol *symbol, unsigned char* codewor
}
symbol->errtxt[strlen(symbol->errtxt) - 1] = '\0'; /* Zap last space */
}
void debug_test_codeword_dump_int(struct zint_symbol *symbol, int* codewords, int length) {
int i, max = 0, cnt_len, errtxt_len;
char temp[20];
errtxt_len = sprintf(symbol->errtxt, "(%d) ", length); /* Place the number of codewords at the front */
for (i = 0, cnt_len = errtxt_len; i < length; i++) {
cnt_len += sprintf(temp, "%d ", codewords[i]);
if (cnt_len > 92) {
break;
}
max++;
}
for (i = 0; i < max; i++) {
errtxt_len += sprintf(symbol->errtxt + errtxt_len, "%d ", codewords[i]);
}
symbol->errtxt[strlen(symbol->errtxt) - 1] = '\0'; /* Zap last space */
}
#endif