mirror of
https://git.code.sf.net/p/zint/code
synced 2026-07-31 02:19:50 +00:00
CLI: make --mirror available in standard non-batch mode via
new routines `mirror_start()`, `mirror_outfile()` & limit substitutions on Unix to backslash (Windows remains the same); restrict "borderwidth", "textgap", "vwhitesp", "whitesp" < 100 CODEONE: fix `ceilf()` -> `C1_MULT_CEIL()` in FAST_MODE encodation (improves/changes some encodation) composite: preserve `gs1_verify()` warning using `warn_level` hack; fix wrong name `zint_dbar_omnstk_set_height()` -> `zint_dbar_stk_set_height()`; use new `zint_micropdf_variant()` & `zint_micropdf_expand()` routines (see below) MICROPDF417: move variant determination into new shareable routine `zint_micropdf_variant()` & expansion into `zint_micropdf_expand()` qzint: add helper methods `setbordertypevalue()`, `encodedinputmode()`, `encodedoutputoptions()`, `ecivaluetoeciindex()` and `eciindextoecivalue()` dbar: for performance pre-calculate `combins()` as array coverage: add `malloc()`-type failure testing to AZTEC, CONTENT_SEGS, MEMORY_FILE, raster, Reed-Solomon & vector; numerous changes to remove unused code and test more branches common: add `isxdigit()` general: various code fiddlings manual: add char names to sequence and batch format char tables; mention long options can be shortened (& use "--compliantheight" -> "--compliant"); expand mirror explanation & document substitutions in footnote; workaround xecjk putting space after double quote when quoting cjk chars & rejig input mode examples; workaround html alignment bug in table gs1-enabled symbologies by adding extra rh dashes to header cols; add "figure nn: " to txt image tags via sed: various other small fixes and rephrasings
This commit is contained in:
+8
-15
@@ -559,9 +559,7 @@ static int isbnx(struct zint_symbol *symbol, unsigned char source[], const int l
|
||||
char check_digit;
|
||||
|
||||
z_to_upper(source, length);
|
||||
if (z_not_sane(ISBNX_SANE_F, source, length)) { /* As source has been zero-padded, don't report position */
|
||||
return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 277, "Invalid character in input (digits and \"X\" only)");
|
||||
}
|
||||
assert(!z_not_sane(ISBNX_SANE_F, source, length)); /* Prior checks ensure this */
|
||||
|
||||
/* Input must be 9, 10 or 13 characters */
|
||||
if (length != 9 && length != 10 && length != 13) {
|
||||
@@ -942,6 +940,9 @@ INTERNAL int zint_eanx_cc(struct zint_symbol *symbol, unsigned char source[], in
|
||||
case BARCODE_EANX:
|
||||
case BARCODE_EANX_CHK:
|
||||
case BARCODE_EAN13:
|
||||
/* Checks in `zint_ean_leading_zeroes()` ensure following */
|
||||
assert(first_part_len == 2 || first_part_len == 5 || first_part_len == 7 || first_part_len == 8
|
||||
|| first_part_len == 12 || first_part_len == 13);
|
||||
switch (first_part_len) {
|
||||
case 2:
|
||||
case 5:
|
||||
@@ -963,18 +964,15 @@ INTERNAL int zint_eanx_cc(struct zint_symbol *symbol, unsigned char source[], in
|
||||
case 13:
|
||||
error_number = ean13(symbol, first_part, first_part_len, dest);
|
||||
break;
|
||||
default:
|
||||
assert(symbol->symbology == BARCODE_EANX || symbol->symbology == BARCODE_EANX_CHK);
|
||||
return z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, 286,
|
||||
"Input length %d wrong (2, 5, 7, 8, 12 or 13 characters required)",
|
||||
first_part_len);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case BARCODE_EANX_CC:
|
||||
case BARCODE_EAN8_CC:
|
||||
case BARCODE_EAN13_CC:
|
||||
switch (first_part_len) { /* Adds vertical separator bars according to ISO/IEC 24723 section 11.4 */
|
||||
/* Checks in `zint_ean_leading_zeroes()` ensure following */
|
||||
assert(first_part_len == 7 || first_part_len == 8 || first_part_len == 12 || first_part_len == 13);
|
||||
switch (first_part_len) {
|
||||
/* Adds vertical separator bars according to ISO/IEC 24723 section 11.4 */
|
||||
case 7:
|
||||
case 8:
|
||||
z_set_module(symbol, symbol->rows, 1);
|
||||
@@ -1003,11 +1001,6 @@ INTERNAL int zint_eanx_cc(struct zint_symbol *symbol, unsigned char source[], in
|
||||
symbol->rows += 3;
|
||||
error_number = ean13_cc(symbol, first_part, first_part_len, dest, cc_rows);
|
||||
break;
|
||||
default:
|
||||
assert(symbol->symbology == BARCODE_EANX_CC);
|
||||
return z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, 287,
|
||||
"Input length %d wrong (7, 12 or 13 characters required)", first_part_len);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case BARCODE_UPCA:
|
||||
|
||||
Reference in New Issue
Block a user