- raster.c: Need ceilf(symbol->height * si) to avoid heap-buffer-overflow;

also avoid distributive multiplication with floats to lessen chances of
  platform variation (#204 ARM-Cortex crash)
- raster.c: Don't allow for text if scale < 1.0
- raster.c: Cast some indexes to (size_t) to allow for large scale
- vector.c: Check malloc()s and return ZINT_ERROR_MEMORY on fail
- raster/vector.c: various var name changes & other code fiddling
- library.c: Check that scale/height/whitespace/border are reasonable values:
  scale (0.01-100), height (0-500), whitespace_width/height (0-100),
  border_width (0-100)
- CLI: allow both e.g. '-height' and '--height' (getopt_long_only())
- gif.c: fix GIF_ZLW_PAGE_SIZE -> GIF_LZW_PAGE_SIZE
- GUI: allow whitespace/scale to 100
This commit is contained in:
gitlost 2021-09-20 14:56:27 +01:00
parent 5766b39845
commit 9bae0b86f9
19 changed files with 870 additions and 814 deletions

View File

@ -5,6 +5,10 @@ Version 2.10.0.9 (dev) not released yet
------------------------ ------------------------
- Add width to struct zint_vector_circle - Add width to struct zint_vector_circle
NOTE: backward incompatible drawing of MaxiCode finder (bullseye) NOTE: backward incompatible drawing of MaxiCode finder (bullseye)
- Check that scale/height/whitespace/border are reasonable values
NOTE: will return error if values outside ranges
- raster.c: Bug fix for heap-buffer-overflow (#204 ARM-Cortex)
NOTE: may cause single-pixel changes to height depending on height/scale used
Changes Changes
------- -------
@ -12,6 +16,10 @@ Changes
- CODE93: don't display check characters in HRT (as per standard Figure B1) - CODE93: don't display check characters in HRT (as per standard Figure B1)
unless option_2 = 1 or vers=1 unless option_2 = 1 or vers=1
- GUI: separate out MAXICODE Structured Carrier Message fields - GUI: separate out MAXICODE Structured Carrier Message fields
- library.c: Check that scale/height/whitespace/border are reasonable values:
scale (0.01-100), height (0-500), whitespace_width/height (0-100),
border_width (0-100)
- CLI: allow both e.g. '-height' and '--height' (getopt_long_only())
Bugs Bugs
---- ----
@ -20,6 +28,10 @@ Bugs
- vector.c: enforce minimum scale >= 0.1 and allow in GUI - vector.c: enforce minimum scale >= 0.1 and allow in GUI
- Suppress some pedantic warnings, props codemonkey82 (#204) - Suppress some pedantic warnings, props codemonkey82 (#204)
- gs1.c: Allow 0-length AI data if GS1NOCHECK_MODE, props codemonkey82 (#204) - gs1.c: Allow 0-length AI data if GS1NOCHECK_MODE, props codemonkey82 (#204)
- raster.c: Need ceilf(symbol->height * si) to avoid heap-buffer-overflow;
also avoid distributive multiplication with floats to lessen chances of
platform variation (#204 ARM-Cortex crash)
- raster.c: Don't allow for text if scale < 1.0
Version 2.10.0 2021-08-14 Version 2.10.0 2021-08-14

View File

@ -41,8 +41,8 @@
#include <malloc.h> #include <malloc.h>
#endif #endif
/* Limit initial ZLW buffer size to this in expectation that compressed data will fit for typical scalings */ /* Limit initial LZW buffer size to this in expectation that compressed data will fit for typical scalings */
#define GIF_ZLW_PAGE_SIZE 0x100000 /* Megabyte */ #define GIF_LZW_PAGE_SIZE 0x100000 /* Megabyte */
typedef struct s_statestruct { typedef struct s_statestruct {
unsigned char *pOut; unsigned char *pOut;
@ -98,7 +98,7 @@ static int BufferNextByte(statestruct *pState) {
} }
if (pState->OutPosCur >= pState->OutLength) { if (pState->OutPosCur >= pState->OutLength) {
unsigned char *pOut; unsigned char *pOut;
pState->OutLength += GIF_ZLW_PAGE_SIZE; pState->OutLength += GIF_LZW_PAGE_SIZE;
/* Note pState->pOut not free()d by realloc() on failure */ /* Note pState->pOut not free()d by realloc() on failure */
if (!(pOut = (unsigned char *) realloc(pState->pOut, pState->OutLength))) { if (!(pOut = (unsigned char *) realloc(pState->pOut, pState->OutLength))) {
return 1; return 1;
@ -309,8 +309,8 @@ INTERNAL int gif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf)
/* Allow for overhead of 4 == code size + byte count + overflow byte + zero terminator */ /* Allow for overhead of 4 == code size + byte count + overflow byte + zero terminator */
unsigned int lzoutbufSize = bitmapSize + 4; unsigned int lzoutbufSize = bitmapSize + 4;
if (lzoutbufSize > GIF_ZLW_PAGE_SIZE) { if (lzoutbufSize > GIF_LZW_PAGE_SIZE) {
lzoutbufSize = GIF_ZLW_PAGE_SIZE; lzoutbufSize = GIF_LZW_PAGE_SIZE;
} }
/* /*

View File

@ -1049,8 +1049,24 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
} }
} }
if ((symbol->scale < 0.01f) || (symbol->scale > 100.0f)) {
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "227: Scale out of range (0.01-100)");
}
if ((symbol->dot_size < 0.01f) || (symbol->dot_size > 20.0f)) { if ((symbol->dot_size < 0.01f) || (symbol->dot_size > 20.0f)) {
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "221: Invalid dot size"); return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "221: Dot size out of range (0.01-20)");
}
if ((symbol->height < 0.0f) || (symbol->height > 500.0f)) {
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "765: Height out of range (0-500)");
}
if ((symbol->whitespace_width < 0) || (symbol->whitespace_width > 100)) {
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "766: Whitespace width out of range (0-100)");
}
if ((symbol->whitespace_height < 0) || (symbol->whitespace_height > 100)) {
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "767: Whitespace height out of range (0-100)");
}
if ((symbol->border_width < 0) || (symbol->border_width > 100)) {
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "768: Border width out of range (0-100)");
} }
if ((symbol->input_mode & 0x07) > 2) { if ((symbol->input_mode & 0x07) > 2) {

View File

@ -69,7 +69,7 @@ INTERNAL int output_check_colour_options(struct zint_symbol *symbol) {
} }
/* Return minimum quiet zones for each symbology */ /* Return minimum quiet zones for each symbology */
static int quiet_zones(struct zint_symbol *symbol, float *left, float *right, float *top, float *bottom) { static int quiet_zones(const struct zint_symbol *symbol, float *left, float *right, float *top, float *bottom) {
int done = 0; int done = 0;
*left = *right = *top = *bottom = 0.0f; *left = *right = *top = *bottom = 0.0f;
@ -427,8 +427,9 @@ static int quiet_zones(struct zint_symbol *symbol, float *left, float *right, fl
} }
/* Set left (x), top (y), right and bottom offsets for whitespace */ /* Set left (x), top (y), right and bottom offsets for whitespace */
INTERNAL void output_set_whitespace_offsets(struct zint_symbol *symbol, float *xoffset, float *yoffset, INTERNAL void output_set_whitespace_offsets(const struct zint_symbol *symbol,
float *roffset, float *boffset) { float *xoffset, float *yoffset, float *roffset, float *boffset, const float scaler,
int *xoffset_si, int *yoffset_si, int *roffset_si, int *boffset_si) {
float qz_left, qz_right, qz_top, qz_bottom; float qz_left, qz_right, qz_top, qz_bottom;
quiet_zones(symbol, &qz_left, &qz_right, &qz_top, &qz_bottom); quiet_zones(symbol, &qz_left, &qz_right, &qz_top, &qz_bottom);
@ -446,14 +447,29 @@ INTERNAL void output_set_whitespace_offsets(struct zint_symbol *symbol, float *x
*yoffset += symbol->border_width; *yoffset += symbol->border_width;
*boffset += symbol->border_width; *boffset += symbol->border_width;
} }
if (scaler) {
if (xoffset_si) {
*xoffset_si = (int) (*xoffset * scaler);
}
if (yoffset_si) {
*yoffset_si = (int) (*yoffset * scaler);
}
if (roffset_si) {
*roffset_si = (int) (*roffset * scaler);
}
if (boffset_si) {
*boffset_si = (int) (*boffset * scaler);
}
}
} }
/* Set composite offset and main width excluding addon (for start of addon calc) and addon text, returning /* Set composite offset and main width excluding addon (for start of addon calc) and addon text, returning
UPC/EAN type */ UPC/EAN type */
INTERNAL int output_process_upcean(struct zint_symbol *symbol, int *p_main_width, int *p_comp_offset, INTERNAL int output_process_upcean(const struct zint_symbol *symbol, int *p_main_width, int *p_comp_xoffset,
unsigned char addon[6], int *p_addon_gap) { unsigned char addon[6], int *p_addon_gap) {
int main_width; /* Width of main linear symbol, excluding addon */ int main_width; /* Width of main linear symbol, excluding addon */
int comp_offset; /* Whitespace offset (if any) of main linear symbol due to having composite */ int comp_xoffset; /* Whitespace offset (if any) of main linear symbol due to having composite */
int upceanflag; /* UPC/EAN type flag */ int upceanflag; /* UPC/EAN type flag */
int i, j, latch; int i, j, latch;
int text_length = (int) ustrlen(symbol->text); int text_length = (int) ustrlen(symbol->text);
@ -480,10 +496,10 @@ INTERNAL int output_process_upcean(struct zint_symbol *symbol, int *p_main_width
} }
/* Calculate composite offset */ /* Calculate composite offset */
comp_offset = 0; comp_xoffset = 0;
if (is_composite(symbol->symbology)) { if (is_composite(symbol->symbology)) {
while (!(module_is_set(symbol, symbol->rows - 1, comp_offset))) { while (!(module_is_set(symbol, symbol->rows - 1, comp_xoffset))) {
comp_offset++; comp_xoffset++;
} }
} }
@ -495,7 +511,7 @@ INTERNAL int output_process_upcean(struct zint_symbol *symbol, int *p_main_width
case 13: /* EAN-13 */ case 13: /* EAN-13 */
case 16: /* EAN-13 + EAN-2 */ case 16: /* EAN-13 + EAN-2 */
case 19: /* EAN-13 + EAN-5 */ case 19: /* EAN-13 + EAN-5 */
main_width = 95 + comp_offset; /* EAN-13 main symbol 95 modules wide */ main_width = 95 + comp_xoffset; /* EAN-13 main symbol 95 modules wide */
upceanflag = 13; upceanflag = 13;
break; break;
case 2: case 2:
@ -507,21 +523,21 @@ INTERNAL int output_process_upcean(struct zint_symbol *symbol, int *p_main_width
upceanflag = 5; upceanflag = 5;
break; break;
default: default:
main_width = 68 + comp_offset; /* EAN-8 main symbol 68 modules wide */ main_width = 68 + comp_xoffset; /* EAN-8 main symbol 68 modules wide */
upceanflag = 8; upceanflag = 8;
break; break;
} }
} else if ((symbol->symbology == BARCODE_UPCA) || (symbol->symbology == BARCODE_UPCA_CHK) } else if ((symbol->symbology == BARCODE_UPCA) || (symbol->symbology == BARCODE_UPCA_CHK)
|| (symbol->symbology == BARCODE_UPCA_CC)) { || (symbol->symbology == BARCODE_UPCA_CC)) {
main_width = 95 + comp_offset; /* UPC-A main symbol 95 modules wide */ main_width = 95 + comp_xoffset; /* UPC-A main symbol 95 modules wide */
upceanflag = 12; upceanflag = 12;
} else if ((symbol->symbology == BARCODE_UPCE) || (symbol->symbology == BARCODE_UPCE_CHK) } else if ((symbol->symbology == BARCODE_UPCE) || (symbol->symbology == BARCODE_UPCE_CHK)
|| (symbol->symbology == BARCODE_UPCE_CC)) { || (symbol->symbology == BARCODE_UPCE_CC)) {
main_width = 51 + comp_offset; /* UPC-E main symbol 51 modules wide */ main_width = 51 + comp_xoffset; /* UPC-E main symbol 51 modules wide */
upceanflag = 6; upceanflag = 6;
} }
*p_comp_offset = comp_offset; *p_comp_xoffset = comp_xoffset;
*p_main_width = main_width; *p_main_width = main_width;
return upceanflag; return upceanflag;

View File

@ -1,7 +1,7 @@
/* output.h - Common routines for raster/vector /* output.h - Common routines for raster/vector
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2020 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2020 - 2021 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions
@ -38,9 +38,10 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
INTERNAL int output_check_colour_options(struct zint_symbol *symbol); INTERNAL int output_check_colour_options(struct zint_symbol *symbol);
INTERNAL void output_set_whitespace_offsets(struct zint_symbol *symbol, float *xoffset, float *yoffset, INTERNAL void output_set_whitespace_offsets(const struct zint_symbol *symbol,
float *roffset, float *boffset); float *xoffset, float *yoffset, float *roffset, float *boffset, const float scaler,
INTERNAL int output_process_upcean(struct zint_symbol *symbol, int *p_main_width, int *p_comp_offset, int *xoffset_si, int *yoffset_si, int *roffset_si, int *boffset_si);
INTERNAL int output_process_upcean(const struct zint_symbol *symbol, int *p_main_width, int *p_comp_xoffset,
unsigned char addon[6], int *p_addon_gap); unsigned char addon[6], int *p_addon_gap);
INTERNAL float output_large_bar_height(struct zint_symbol *symbol, int si); INTERNAL float output_large_bar_height(struct zint_symbol *symbol, int si);
INTERNAL void output_upcean_split_text(int upceanflag, unsigned char text[], INTERNAL void output_upcean_split_text(int upceanflag, unsigned char text[],

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -163,6 +163,10 @@ static void test_print(int index, int generate, int debug) {
/* 21*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, 0, 0, 0, "00000000", "FFFFFF00", "12", "dotcode_bgfgtrans.gif", "" }, /* 21*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, 0, 0, 0, "00000000", "FFFFFF00", "12", "dotcode_bgfgtrans.gif", "" },
/* 22*/ { BARCODE_ULTRA, 1, BARCODE_BOX, 1, 1, -1, -1, 0, 0, 0, "0000FF", "FF0000", "12", "ultra_fgbg_hvwsp1_box1.gif", "" }, /* 22*/ { BARCODE_ULTRA, 1, BARCODE_BOX, 1, 1, -1, -1, 0, 0, 0, "0000FF", "FF0000", "12", "ultra_fgbg_hvwsp1_box1.gif", "" },
/* 23*/ { BARCODE_ITF14, 4, BARCODE_BIND, 24, -1, -1, -1, 61.8, 3, 0, "", "", "0501054800395", "itf14_height61.8_bind4_wsp24_3.gif", "#204 ARM-Cortex crash" }, /* 23*/ { BARCODE_ITF14, 4, BARCODE_BIND, 24, -1, -1, -1, 61.8, 3, 0, "", "", "0501054800395", "itf14_height61.8_bind4_wsp24_3.gif", "#204 ARM-Cortex crash" },
/* 24*/ { BARCODE_ITF14, 0, BARCODE_BIND, -1, -1, -1, -1, 0.5, 0.5, 0, "", "", "0501054800395", "itf14_height0.5_box0_0.5.gif", "No box, no text" },
/* 25*/ { BARCODE_ITF14, -1, -1, -1, -1, -1, -1, 0.5, 1.1, 0, "", "", "0501054800395", "itf14_height0.5_1.1.gif", "" },
/* 26*/ { BARCODE_CODE16K, -1, -1, 3, 5, -1, -1, 0.5, 0, 0, "", "", "1234567890", "code16k_height0.5_wsp3_vwsp5.gif", "Separator covers bars" },
/* 27*/ { BARCODE_CODE16K, -1, -1, 3, 5, -1, -1, 1.5, 0, 0, "", "", "1234567890", "code16k_height1.5_wsp3_vwsp5.gif", "" },
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;

View File

@ -43,6 +43,11 @@ static void test_checks(int index, int debug) {
int length; int length;
int input_mode; int input_mode;
int eci; int eci;
float height;
int whitespace_width;
int whitespace_height;
int border_width;
float scale;
float dot_size; float dot_size;
int warn_level; int warn_level;
int ret; int ret;
@ -52,146 +57,157 @@ static void test_checks(int index, int debug) {
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
/* 0*/ { BARCODE_CODE128, -1, "1234", -1, -1, 3, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 217: Symbology does not support ECI switching", -1 }, /* 0*/ { BARCODE_CODE128, -1, "1234", -1, -1, 3, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 217: Symbology does not support ECI switching", -1 },
/* 1*/ { BARCODE_CODE128, -1, "1234", -1, -1, 0, -1, -1, 0, "", -1 }, /* 1*/ { BARCODE_CODE128, -1, "1234", -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, "", -1 },
/* 2*/ { BARCODE_QRCODE, -1, "1234", -1, -1, 3, -1, -1, 0, "", -1 }, /* 2*/ { BARCODE_QRCODE, -1, "1234", -1, -1, 3, 0, 0, 0, 0, -1, -1, -1, 0, "", -1 },
/* 3*/ { BARCODE_QRCODE, -1, "1234", -1, -1, 999999 + 1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 218: Invalid ECI mode", -1 }, /* 3*/ { BARCODE_QRCODE, -1, "1234", -1, -1, 999999 + 1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 218: Invalid ECI mode", -1 },
/* 4*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 20.1, -1, ZINT_ERROR_INVALID_OPTION, "Error 221: Invalid dot size", -1 }, /* 4*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 0, 0, 0, 0.009, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 227: Scale out of range (0.01-100)", -1 },
/* 5*/ { BARCODE_CODE128, -1, "1234", -1, GS1_MODE, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode", -1 }, /* 5*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 0, 0, 0, 100.01, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 227: Scale out of range (0.01-100)", -1 },
/* 6*/ { BARCODE_GS1_128, -1, "[21]12\0004", 8, GS1_MODE, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 262: NUL characters not permitted in GS1 mode", -1 }, /* 6*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 0, 0, 0, -1, 20.1, -1, ZINT_ERROR_INVALID_OPTION, "Error 221: Dot size out of range (0.01-20)", -1 },
/* 7*/ { BARCODE_GS1_128, -1, "[21]12é4", -1, GS1_MODE, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1", -1 }, /* 7*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 0, 0, 0, 0.01, 0.009, -1, ZINT_ERROR_INVALID_OPTION, "Error 221: Dot size out of range (0.01-20)", -1 },
/* 8*/ { BARCODE_GS1_128, -1, "[21]12\0074", -1, GS1_MODE, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 251: Control characters are not supported by GS1", -1 }, /* 8*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, -0.1, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 765: Height out of range (0-500)", -1 },
/* 9*/ { BARCODE_GS1_128, -1, "[21]1234", -1, GS1_MODE, -1, -1, -1, 0, "", -1 }, /* 9*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 500.01, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 765: Height out of range (0-500)", -1 },
/* 10*/ { 0, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 206: Symbology out of range", BARCODE_CODE128 }, /* 10*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, -1, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 766: Whitespace width out of range (0-100)", -1 },
/* 11*/ { 0, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 }, /* 11*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 101, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 766: Whitespace width out of range (0-100)", -1 },
/* 12*/ { 0, -1, "1", -1, -1, 1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 217: Symbology does not support ECI switching", BARCODE_CODE128 }, // Not supporting beats invalid ECI /* 12*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 767: Whitespace height out of range (0-100)", -1 },
/* 13*/ { 0, -1, "1", -1, -1, 1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 }, /* 13*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 0, 101, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 767: Whitespace height out of range (0-100)", -1 },
/* 14*/ { 0, -1, "1", -1, -1, -1, 0.009, -1, ZINT_ERROR_INVALID_OPTION, "Error 221: Invalid dot size", BARCODE_CODE128 }, /* 14*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 768: Border width out of range (0-100)", -1 },
/* 15*/ { 0, -1, "1", -1, -1, -1, 0.009, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 }, /* 15*/ { BARCODE_CODE128, -1, "1234", -1, -1, -1, 0, 0, 0, 101, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 768: Border width out of range (0-100)", -1 },
/* 16*/ { 0, -1, "1", -1, -1, 1, 0.009, -1, ZINT_ERROR_INVALID_OPTION, "Error 217: Symbology does not support ECI switching", BARCODE_CODE128 }, // Invalid dot size no longer beats invalid ECI /* 16*/ { BARCODE_CODE128, -1, "1234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode", -1 },
/* 17*/ { 0, -1, "1", -1, -1, -1, 0.009, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 }, /* 17*/ { BARCODE_GS1_128, -1, "[21]12\0004", 8, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 262: NUL characters not permitted in GS1 mode", -1 },
/* 18*/ { 5, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_C25STANDARD }, /* 18*/ { BARCODE_GS1_128, -1, "[21]12é4", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1", -1 },
/* 19*/ { 5, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_C25STANDARD }, /* 19*/ { BARCODE_GS1_128, -1, "[21]12\0074", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 251: Control characters are not supported by GS1", -1 },
/* 20*/ { 10, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_EANX }, /* 20*/ { BARCODE_GS1_128, -1, "[21]1234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", -1 },
/* 21*/ { 10, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX }, /* 21*/ { 0, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 206: Symbology out of range", BARCODE_CODE128 },
/* 22*/ { 11, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_EANX }, /* 22*/ { 0, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 },
/* 23*/ { 11, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX }, /* 23*/ { 0, -1, "1", -1, -1, 1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 217: Symbology does not support ECI switching", BARCODE_CODE128 }, // Not supporting beats invalid ECI
/* 24*/ { 12, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_EANX }, /* 24*/ { 0, -1, "1", -1, -1, 1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 },
/* 25*/ { 12, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX }, /* 25*/ { 0, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, 0.009, -1, ZINT_ERROR_INVALID_OPTION, "Error 221: Dot size out of range (0.01-20)", BARCODE_CODE128 },
/* 26*/ { 15, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_EANX }, /* 26*/ { 0, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, 0.009, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 },
/* 27*/ { 15, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX }, /* 27*/ { 0, -1, "1", -1, -1, 1, 0, 0, 0, 0, -1, 0.009, -1, ZINT_ERROR_INVALID_OPTION, "Error 217: Symbology does not support ECI switching", BARCODE_CODE128 }, // Invalid dot size no longer beats invalid ECI
/* 28*/ { 17, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_UPCA }, /* 28*/ { 0, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, 0.009, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 },
/* 29*/ { 17, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_UPCA }, /* 29*/ { 5, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_C25STANDARD },
/* 30*/ { 19, -1, "1", -1, -1, -1, -1, -1, ZINT_ERROR_TOO_LONG, "Error 362: Input too short (3 character minimum)", BARCODE_CODABAR }, /* 30*/ { 5, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_C25STANDARD },
/* 31*/ { 19, -1, "A1B", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 207: Codabar 18 not supported", BARCODE_CODABAR }, /* 31*/ { 10, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_EANX },
/* 32*/ { 19, -1, "A1B", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 207: Codabar 18 not supported", -1 }, /* 32*/ { 10, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX },
/* 33*/ { 26, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_UPCA }, /* 33*/ { 11, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_EANX },
/* 34*/ { 26, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_UPCA }, /* 34*/ { 11, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX },
/* 35*/ { 27, -1, "1", -1, -1, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 208: UPCD1 not supported", 27 }, /* 35*/ { 12, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_EANX },
/* 36*/ { 33, -1, "1", -1, -1, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI", BARCODE_GS1_128 }, /* 36*/ { 12, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX },
/* 37*/ { 33, -1, "[10]23", -1, -1, -1, -1, -1, 0, "", BARCODE_GS1_128 }, /* 37*/ { 15, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_EANX },
/* 38*/ { 33, -1, "[10]23", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_GS1_128 }, /* 38*/ { 15, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX },
/* 39*/ { 36, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_UPCA }, /* 39*/ { 17, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_UPCA },
/* 40*/ { 36, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_UPCA }, /* 40*/ { 17, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_UPCA },
/* 41*/ { 39, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_UPCE }, /* 41*/ { 19, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_TOO_LONG, "Error 362: Input too short (3 character minimum)", BARCODE_CODABAR },
/* 42*/ { 39, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_UPCE }, /* 42*/ { 19, -1, "A1B", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 207: Codabar 18 not supported", BARCODE_CODABAR },
/* 43*/ { 41, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_NONCOMPLIANT, "Warning 479: Input length is not standard (5, 9 or 11 characters)", BARCODE_POSTNET }, /* 43*/ { 19, -1, "A1B", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 207: Codabar 18 not supported", -1 },
/* 44*/ { 41, -1, "12345", -1, -1, -1, -1, -1, 0, "", BARCODE_POSTNET }, /* 44*/ { 26, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_UPCA },
/* 45*/ { 41, -1, "12345", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET }, /* 45*/ { 26, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_UPCA },
/* 46*/ { 42, -1, "12345", -1, -1, -1, -1, -1, 0, "", BARCODE_POSTNET }, /* 46*/ { 27, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 208: UPCD1 not supported", 27 },
/* 47*/ { 42, -1, "12345", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET }, /* 47*/ { 33, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI", BARCODE_GS1_128 },
/* 48*/ { 43, -1, "12345", -1, -1, -1, -1, -1, 0, "", BARCODE_POSTNET }, /* 48*/ { 33, -1, "[10]23", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_GS1_128 },
/* 49*/ { 43, -1, "12345", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET }, /* 49*/ { 33, -1, "[10]23", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_GS1_128 },
/* 50*/ { 44, -1, "12345", -1, -1, -1, -1, -1, 0, "", BARCODE_POSTNET }, /* 50*/ { 36, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_UPCA },
/* 51*/ { 44, -1, "12345", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET }, /* 51*/ { 36, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_UPCA },
/* 52*/ { 45, -1, "12345", -1, -1, -1, -1, -1, 0, "", BARCODE_POSTNET }, /* 52*/ { 39, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_UPCE },
/* 53*/ { 45, -1, "12345", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET }, /* 53*/ { 39, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_UPCE },
/* 54*/ { 46, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_PLESSEY }, /* 54*/ { 41, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_NONCOMPLIANT, "Warning 479: Input length is not standard (5, 9 or 11 characters)", BARCODE_POSTNET },
/* 55*/ { 46, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_PLESSEY }, /* 55*/ { 41, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_POSTNET },
/* 56*/ { 48, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_NVE18 }, /* 56*/ { 41, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET },
/* 57*/ { 48, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_NVE18 }, /* 57*/ { 42, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_POSTNET },
/* 58*/ { 54, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 210: General Parcel Code not supported", BARCODE_CODE128 }, /* 58*/ { 42, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET },
/* 59*/ { 54, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 210: General Parcel Code not supported", -1 }, /* 59*/ { 43, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_POSTNET },
/* 60*/ { 59, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_CODE128 }, /* 60*/ { 43, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET },
/* 61*/ { 59, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_CODE128 }, /* 61*/ { 44, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_POSTNET },
/* 62*/ { 61, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_CODE128 }, /* 62*/ { 44, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET },
/* 63*/ { 61, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_CODE128 }, /* 63*/ { 45, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_POSTNET },
/* 64*/ { 62, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_CODE93 }, /* 64*/ { 45, -1, "12345", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_POSTNET },
/* 65*/ { 62, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_CODE93 }, /* 65*/ { 46, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_PLESSEY },
/* 66*/ { 64, -1, "12345678", -1, -1, -1, -1, -1, 0, "", BARCODE_AUSPOST }, /* 66*/ { 46, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_PLESSEY },
/* 67*/ { 64, -1, "12345678", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_AUSPOST }, /* 67*/ { 48, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_NVE18 },
/* 68*/ { 65, -1, "12345678", -1, -1, -1, -1, -1, 0, "", BARCODE_AUSPOST }, /* 68*/ { 48, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_NVE18 },
/* 69*/ { 65, -1, "12345678", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_AUSPOST }, /* 69*/ { 54, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 210: General Parcel Code not supported", BARCODE_CODE128 },
/* 70*/ { 78, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_DBAR_OMN }, /* 70*/ { 54, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 210: General Parcel Code not supported", -1 },
/* 71*/ { 78, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_DBAR_OMN }, /* 71*/ { 59, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_CODE128 },
/* 72*/ { 83, -1, "12345678901", -1, -1, -1, -1, -1, 0, "", BARCODE_PLANET }, /* 72*/ { 59, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_CODE128 },
/* 73*/ { 83, -1, "12345678901", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_PLANET }, /* 73*/ { 61, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_CODE128 },
/* 74*/ { 88, -1, "1", -1, -1, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI", BARCODE_GS1_128 }, /* 74*/ { 61, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_CODE128 },
/* 75*/ { 88, -1, "[10]12", -1, -1, -1, -1, -1, 0, "", BARCODE_GS1_128 }, /* 75*/ { 62, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_CODE93 },
/* 76*/ { 88, -1, "[10]12", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_GS1_128 }, /* 76*/ { 62, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_CODE93 },
/* 77*/ { 91, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 212: Symbology out of range", BARCODE_CODE128 }, /* 77*/ { 64, -1, "12345678", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_AUSPOST },
/* 78*/ { 91, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 212: Symbology out of range", -1 }, /* 78*/ { 64, -1, "12345678", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_AUSPOST },
/* 79*/ { 94, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 213: Symbology out of range", BARCODE_CODE128 }, /* 79*/ { 65, -1, "12345678", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_AUSPOST },
/* 80*/ { 94, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 213: Symbology out of range", -1 }, /* 80*/ { 65, -1, "12345678", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_AUSPOST },
/* 81*/ { 95, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 213: Symbology out of range", BARCODE_CODE128 }, /* 81*/ { 78, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_DBAR_OMN },
/* 82*/ { 95, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 213: Symbology out of range", -1 }, /* 82*/ { 78, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_DBAR_OMN },
/* 83*/ { 100, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_HIBC_128 }, /* 83*/ { 83, -1, "12345678901", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_PLANET },
/* 84*/ { 100, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_128 }, /* 84*/ { 83, -1, "12345678901", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_PLANET },
/* 85*/ { 101, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_HIBC_39 }, /* 85*/ { 88, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI", BARCODE_GS1_128 },
/* 86*/ { 101, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_39 }, /* 86*/ { 88, -1, "[10]12", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_GS1_128 },
/* 87*/ { 103, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_HIBC_DM }, /* 87*/ { 88, -1, "[10]12", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_GS1_128 },
/* 88*/ { 103, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_DM }, /* 88*/ { 91, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 212: Symbology out of range", BARCODE_CODE128 },
/* 89*/ { 105, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_HIBC_QR }, /* 89*/ { 91, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 212: Symbology out of range", -1 },
/* 90*/ { 105, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_QR }, /* 90*/ { 94, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 213: Symbology out of range", BARCODE_CODE128 },
/* 91*/ { 107, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_HIBC_PDF }, /* 91*/ { 94, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 213: Symbology out of range", -1 },
/* 92*/ { 107, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_PDF }, /* 92*/ { 95, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 213: Symbology out of range", BARCODE_CODE128 },
/* 93*/ { 109, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_HIBC_MICPDF }, /* 93*/ { 95, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 213: Symbology out of range", -1 },
/* 94*/ { 109, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_MICPDF }, /* 94*/ { 100, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_HIBC_128 },
/* 95*/ { 111, -1, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_HIBC_BLOCKF }, /* 95*/ { 100, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_128 },
/* 96*/ { 111, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_BLOCKF }, /* 96*/ { 101, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_HIBC_39 },
/* 97*/ { 113, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 214: Symbology out of range", BARCODE_CODE128 }, /* 97*/ { 101, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_39 },
/* 98*/ { 113, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 214: Symbology out of range", -1 }, /* 98*/ { 103, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_HIBC_DM },
/* 99*/ { 114, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 214: Symbology out of range", BARCODE_CODE128 }, /* 99*/ { 103, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_DM },
/*100*/ { 114, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 214: Symbology out of range", -1 }, /*100*/ { 105, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_HIBC_QR },
/*101*/ { 117, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*101*/ { 105, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_QR },
/*102*/ { 117, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*102*/ { 107, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_HIBC_PDF },
/*103*/ { 118, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*103*/ { 107, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_PDF },
/*104*/ { 118, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*104*/ { 109, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_HIBC_MICPDF },
/*105*/ { 119, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*105*/ { 109, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_MICPDF },
/*106*/ { 119, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*106*/ { 111, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, "", BARCODE_HIBC_BLOCKF },
/*107*/ { 120, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*107*/ { 111, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_HIBC_BLOCKF },
/*108*/ { 120, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*108*/ { 113, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 214: Symbology out of range", BARCODE_CODE128 },
/*109*/ { 122, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*109*/ { 113, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 214: Symbology out of range", -1 },
/*110*/ { 122, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*110*/ { 114, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 214: Symbology out of range", BARCODE_CODE128 },
/*111*/ { 123, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*111*/ { 114, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 214: Symbology out of range", -1 },
/*112*/ { 123, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*112*/ { 117, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*113*/ { 124, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*113*/ { 117, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*114*/ { 124, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*114*/ { 118, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*115*/ { 125, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*115*/ { 118, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*116*/ { 125, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*116*/ { 119, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*117*/ { 126, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*117*/ { 119, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*118*/ { 126, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*118*/ { 120, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*119*/ { 127, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 }, /*119*/ { 120, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*120*/ { 127, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 }, /*120*/ { 122, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*121*/ { 146, -1, "1", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 216: Symbology out of range", BARCODE_CODE128 }, /*121*/ { 122, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*122*/ { 146, -1, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 216: Symbology out of range", -1 }, /*122*/ { 123, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*123*/ { BARCODE_CODE128, -1, "\200", -1, UNICODE_MODE, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input data", -1 }, /*123*/ { 123, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*124*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, -1, -1, ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 }, /*124*/ { 124, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*125*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 }, /*125*/ { 124, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*126*/ { BARCODE_QRCODE, -1, "", -1, UNICODE_MODE, 13, -1, -1, 0, "", -1 }, /*126*/ { 125, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*127*/ { BARCODE_QRCODE, -1, "", -1, UNICODE_MODE, -1, -1, -1, ZINT_WARN_USES_ECI, "Warning 222: Encoded data includes ECI 13", -1 }, /*127*/ { 125, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*128*/ { BARCODE_QRCODE, -1, "", -1, UNICODE_MODE, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_USES_ECI, "Error 222: Encoded data includes ECI 13", -1 }, /*128*/ { 126, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*129*/ { BARCODE_CODEONE, -1, "[01]12345678901231", -1, GS1_MODE, 3, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 512: ECI ignored for GS1 mode", -1 }, /*129*/ { 126, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*130*/ { BARCODE_CODEONE, -1, "[01]12345678901231", -1, GS1_MODE, 3, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 512: ECI ignored for GS1 mode", -1 }, /*130*/ { 127, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 215: Symbology out of range", BARCODE_CODE128 },
/*131*/ { BARCODE_CODEONE, -1, "[01]12345678901234", -1, GS1_MODE, 3, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 512: ECI ignored for GS1 mode", -1 }, // Warning in encoder overrides library warnings /*131*/ { 127, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 215: Symbology out of range", -1 },
/*132*/ { BARCODE_CODEONE, -1, "[01]12345678901234", -1, GS1_MODE, 3, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 }, // But not errors /*132*/ { 146, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 216: Symbology out of range", BARCODE_CODE128 },
/*133*/ { BARCODE_AZTEC, -1, "", -1, UNICODE_MODE, 13, -1, -1, 0, "", -1 }, /*133*/ { 146, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 216: Symbology out of range", -1 },
/*134*/ { BARCODE_AZTEC, -1, "", -1, UNICODE_MODE, -1, -1, -1, ZINT_WARN_USES_ECI, "Warning 222: Encoded data includes ECI 13", -1 }, /*134*/ { BARCODE_CODE128, -1, "\200", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input data", -1 },
/*135*/ { BARCODE_AZTEC, -1, "", -1, UNICODE_MODE, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_USES_ECI, "Error 222: Encoded data includes ECI 13", -1 }, /*135*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 },
/*136*/ { BARCODE_AZTEC, 6, "", -1, UNICODE_MODE, 13, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 503: Invalid error correction level - using default instead", -1 }, /*136*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 },
/*137*/ { BARCODE_AZTEC, 6, "", -1, UNICODE_MODE, 13, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 503: Invalid error correction level - using default instead", -1 }, /*137*/ { BARCODE_QRCODE, -1, "", -1, UNICODE_MODE, 13, 0, 0, 0, 0, -1, -1, -1, 0, "", -1 },
/*138*/ { BARCODE_AZTEC, 6, "", -1, UNICODE_MODE, -1, -1, -1, ZINT_WARN_USES_ECI, "Warning 222: Encoded data includes ECI 13", -1 }, // ECI warning trumps all other warnings /*138*/ { BARCODE_QRCODE, -1, "", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_USES_ECI, "Warning 222: Encoded data includes ECI 13", -1 },
/*139*/ { BARCODE_AZTEC, 6, "", -1, UNICODE_MODE, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 503: Invalid error correction level - using default instead", -1 }, // But not errors /*139*/ { BARCODE_QRCODE, -1, "", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_USES_ECI, "Error 222: Encoded data includes ECI 13", -1 },
/*140*/ { BARCODE_CODEONE, -1, "[01]12345678901231", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 512: ECI ignored for GS1 mode", -1 },
/*141*/ { BARCODE_CODEONE, -1, "[01]12345678901231", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 512: ECI ignored for GS1 mode", -1 },
/*142*/ { BARCODE_CODEONE, -1, "[01]12345678901234", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 512: ECI ignored for GS1 mode", -1 }, // Warning in encoder overrides library warnings
/*143*/ { BARCODE_CODEONE, -1, "[01]12345678901234", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 }, // But not errors
/*144*/ { BARCODE_AZTEC, -1, "", -1, UNICODE_MODE, 13, 0, 0, 0, 0, -1, -1, -1, 0, "", -1 },
/*145*/ { BARCODE_AZTEC, -1, "", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_USES_ECI, "Warning 222: Encoded data includes ECI 13", -1 },
/*146*/ { BARCODE_AZTEC, -1, "", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_USES_ECI, "Error 222: Encoded data includes ECI 13", -1 },
/*147*/ { BARCODE_AZTEC, 6, "", -1, UNICODE_MODE, 13, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 503: Invalid error correction level - using default instead", -1 },
/*148*/ { BARCODE_AZTEC, 6, "", -1, UNICODE_MODE, 13, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 503: Invalid error correction level - using default instead", -1 },
/*149*/ { BARCODE_AZTEC, 6, "", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, -1, ZINT_WARN_USES_ECI, "Warning 222: Encoded data includes ECI 13", -1 }, // ECI warning trumps all other warnings
/*150*/ { BARCODE_AZTEC, 6, "", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 503: Invalid error correction level - using default instead", -1 }, // But not errors
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;
@ -207,6 +223,21 @@ static void test_checks(int index, int debug) {
assert_nonnull(symbol, "Symbol not created\n"); assert_nonnull(symbol, "Symbol not created\n");
length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
if (data[i].height) {
symbol->height = data[i].height;
}
if (data[i].whitespace_width) {
symbol->whitespace_width = data[i].whitespace_width;
}
if (data[i].whitespace_height) {
symbol->whitespace_height = data[i].whitespace_height;
}
if (data[i].border_width) {
symbol->border_width = data[i].border_width;
}
if (data[i].scale != -1) {
symbol->scale = data[i].scale;
}
if (data[i].dot_size != -1) { if (data[i].dot_size != -1) {
symbol->dot_size = data[i].dot_size; symbol->dot_size = data[i].dot_size;
} }

View File

@ -138,6 +138,7 @@ static void test_print(int index, int generate, int debug) {
int text_length; int text_length;
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
if ((debug & ZINT_DEBUG_TEST_PRINT) && !(debug & ZINT_DEBUG_TEST_LESS_NOISY)) printf("i:%d\n", i); // ZINT_DEBUG_TEST_PRINT 16
symbol = ZBarcode_Create(); symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n"); assert_nonnull(symbol, "Symbol not created\n");

View File

@ -30,7 +30,6 @@
*/ */
/* vim: set ts=4 sw=4 et : */ /* vim: set ts=4 sw=4 et : */
#include <stdio.h>
#include <math.h> #include <math.h>
#ifdef _MSC_VER #ifdef _MSC_VER
@ -45,11 +44,15 @@ INTERNAL int ps_plot(struct zint_symbol *symbol);
INTERNAL int svg_plot(struct zint_symbol *symbol); INTERNAL int svg_plot(struct zint_symbol *symbol);
INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle); INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle);
static struct zint_vector_rect *vector_plot_create_rect(float x, float y, float width, float height) { static struct zint_vector_rect *vector_plot_create_rect(struct zint_symbol *symbol,
const float x, const float y, const float width, const float height) {
struct zint_vector_rect *rect; struct zint_vector_rect *rect;
rect = (struct zint_vector_rect *) malloc(sizeof(struct zint_vector_rect)); rect = (struct zint_vector_rect *) malloc(sizeof(struct zint_vector_rect));
if (!rect) return NULL; if (!rect) {
strcpy(symbol->errtxt, "691: Insufficient memory for vector rectangle");
return NULL;
}
rect->next = NULL; rect->next = NULL;
rect->x = x; rect->x = x;
@ -61,23 +64,25 @@ static struct zint_vector_rect *vector_plot_create_rect(float x, float y, float
return rect; return rect;
} }
static int vector_plot_add_rect(struct zint_symbol *symbol, struct zint_vector_rect *rect, static void vector_plot_add_rect(struct zint_symbol *symbol, struct zint_vector_rect *rect,
struct zint_vector_rect **last_rect) { struct zint_vector_rect **last_rect) {
if (!rect) return 0;
if (*last_rect) if (*last_rect)
(*last_rect)->next = rect; (*last_rect)->next = rect;
else else
symbol->vector->rectangles = rect; // first rectangle symbol->vector->rectangles = rect; // first rectangle
*last_rect = rect; *last_rect = rect;
return 1;
} }
static struct zint_vector_hexagon *vector_plot_create_hexagon(float x, float y, float diameter) { static struct zint_vector_hexagon *vector_plot_create_hexagon(struct zint_symbol *symbol,
const float x, const float y, const float diameter) {
struct zint_vector_hexagon *hexagon; struct zint_vector_hexagon *hexagon;
hexagon = (struct zint_vector_hexagon *) malloc(sizeof(struct zint_vector_hexagon)); hexagon = (struct zint_vector_hexagon *) malloc(sizeof(struct zint_vector_hexagon));
if (!hexagon) return NULL; if (!hexagon) {
strcpy(symbol->errtxt, "692: Insufficient memory for vector hexagon");
return NULL;
}
hexagon->next = NULL; hexagon->next = NULL;
hexagon->x = x; hexagon->x = x;
hexagon->y = y; hexagon->y = y;
@ -87,24 +92,26 @@ static struct zint_vector_hexagon *vector_plot_create_hexagon(float x, float y,
return hexagon; return hexagon;
} }
static int vector_plot_add_hexagon(struct zint_symbol *symbol, struct zint_vector_hexagon *hexagon, static void vector_plot_add_hexagon(struct zint_symbol *symbol, struct zint_vector_hexagon *hexagon,
struct zint_vector_hexagon **last_hexagon) { struct zint_vector_hexagon **last_hexagon) {
if (!hexagon) return 0;
if (*last_hexagon) if (*last_hexagon)
(*last_hexagon)->next = hexagon; (*last_hexagon)->next = hexagon;
else else
symbol->vector->hexagons = hexagon; // first hexagon symbol->vector->hexagons = hexagon; // first hexagon
*last_hexagon = hexagon; *last_hexagon = hexagon;
return 1;
} }
static struct zint_vector_circle *vector_plot_create_circle(float x, float y, float diameter, float width, static struct zint_vector_circle *vector_plot_create_circle(struct zint_symbol *symbol,
int colour) { const float x, const float y, const float diameter, const float width,
const int colour) {
struct zint_vector_circle *circle; struct zint_vector_circle *circle;
circle = (struct zint_vector_circle *) malloc(sizeof(struct zint_vector_circle)); circle = (struct zint_vector_circle *) malloc(sizeof(struct zint_vector_circle));
if (!circle) return NULL; if (!circle) {
strcpy(symbol->errtxt, "693: Insufficient memory for vector circle");
return NULL;
}
circle->next = NULL; circle->next = NULL;
circle->x = x; circle->x = x;
circle->y = y; circle->y = y;
@ -115,25 +122,26 @@ static struct zint_vector_circle *vector_plot_create_circle(float x, float y, fl
return circle; return circle;
} }
static int vector_plot_add_circle(struct zint_symbol *symbol, struct zint_vector_circle *circle, static void vector_plot_add_circle(struct zint_symbol *symbol, struct zint_vector_circle *circle,
struct zint_vector_circle **last_circle) { struct zint_vector_circle **last_circle) {
if (!circle) return 0;
if (*last_circle) if (*last_circle)
(*last_circle)->next = circle; (*last_circle)->next = circle;
else else
symbol->vector->circles = circle; // first circle symbol->vector->circles = circle; // first circle
*last_circle = circle; *last_circle = circle;
return 1;
} }
static int vector_plot_add_string(struct zint_symbol *symbol, static int vector_plot_add_string(struct zint_symbol *symbol, const unsigned char *text,
unsigned char *text, float x, float y, float fsize, float width, int halign, const float x, const float y, const float fsize, const float width, const int halign,
struct zint_vector_string **last_string) { struct zint_vector_string **last_string) {
struct zint_vector_string *string; struct zint_vector_string *string;
string = (struct zint_vector_string *) malloc(sizeof(struct zint_vector_string)); string = (struct zint_vector_string *) malloc(sizeof(struct zint_vector_string));
if (!string) return 0; if (!string) {
strcpy(symbol->errtxt, "694: Insufficient memory for vector string");
return 0;
}
string->next = NULL; string->next = NULL;
string->x = x; string->x = x;
string->y = y; string->y = y;
@ -142,8 +150,12 @@ static int vector_plot_add_string(struct zint_symbol *symbol,
string->length = (int) ustrlen(text); string->length = (int) ustrlen(text);
string->rotation = 0; string->rotation = 0;
string->halign = halign; string->halign = halign;
string->text = (unsigned char *) malloc(ustrlen(text) + 1); string->text = (unsigned char *) malloc(string->length + 1);
if (!string->text) { free(string); return 0; } if (!string->text) {
free(string);
strcpy(symbol->errtxt, "695: Insufficient memory for vector string text");
return 0;
}
ustrcpy(string->text, text); ustrcpy(string->text, text);
if (*last_string) if (*last_string)
@ -201,7 +213,7 @@ INTERNAL void vector_free(struct zint_symbol *symbol) {
} }
} }
static void vector_scale(struct zint_symbol *symbol, int file_type) { static void vector_scale(struct zint_symbol *symbol, const int file_type) {
struct zint_vector_rect *rect; struct zint_vector_rect *rect;
struct zint_vector_hexagon *hex; struct zint_vector_hexagon *hex;
struct zint_vector_circle *circle; struct zint_vector_circle *circle;
@ -254,10 +266,9 @@ static void vector_scale(struct zint_symbol *symbol, int file_type) {
string->fsize *= scale; string->fsize *= scale;
string = string->next; string = string->next;
} }
return;
} }
static void vector_rotate(struct zint_symbol *symbol, int rotate_angle) { static void vector_rotate(struct zint_symbol *symbol, const int rotate_angle) {
// Rotates the image // Rotates the image
struct zint_vector_rect *rect; struct zint_vector_rect *rect;
struct zint_vector_hexagon *hex; struct zint_vector_hexagon *hex;
@ -355,8 +366,6 @@ static void vector_rotate(struct zint_symbol *symbol, int rotate_angle) {
symbol->vector->height = symbol->vector->width; symbol->vector->height = symbol->vector->width;
symbol->vector->width = temp; symbol->vector->width = temp;
} }
return;
} }
static void vector_reduce_rectangles(struct zint_symbol *symbol) { static void vector_reduce_rectangles(struct zint_symbol *symbol) {
@ -382,45 +391,39 @@ static void vector_reduce_rectangles(struct zint_symbol *symbol) {
rect = rect->next; rect = rect->next;
} }
return;
} }
INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_type) { INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_type) {
int error_number; int error_number;
float large_bar_height; float large_bar_height;
int textdone = 0;
int main_width; int main_width;
int comp_offset = 0; int comp_xoffset = 0;
unsigned char addon[6]; unsigned char addon[6];
int addon_gap = 0; int addon_gap = 0;
float addon_text_posn = 0.0f; float addon_text_yposn = 0.0f;
float addon_bar_height = 0.0f;
float xoffset, yoffset, roffset, boffset; float xoffset, yoffset, roffset, boffset;
float textoffset; float textoffset;
float default_text_posn; float yposn;
float row_height, row_posn;
int upceanflag = 0; int upceanflag = 0;
int addon_latch = 0; int addon_latch = 0;
unsigned char textpart1[5], textpart2[7], textpart3[7], textpart4[2]; unsigned char textpart1[5], textpart2[7], textpart3[7], textpart4[2];
float textpos;
int hide_text; int hide_text;
int i, r; int i, r;
int text_height; /* Font pixel size (so whole integers) */ int text_height; /* Font pixel size (so whole integers) */
float text_gap; /* Gap between barcode and text */
float guard_height;
int upcae_outside_text_height = 0; /* UPC-A/E outside digits font size */ int upcae_outside_text_height = 0; /* UPC-A/E outside digits font size */
float digit_ascent_factor = 0.25f; /* Assuming digit ascent roughly 25% less than font size */ float digit_ascent_factor = 0.25f; /* Assuming digit ascent roughly 25% less than font size */
float text_gap; /* Gap between barcode and text */
float dot_overspill = 0.0f; float dot_overspill = 0.0f;
float dot_offset = 0.0f; float dot_offset = 0.0f;
int rect_count, last_row_start = 0; int rect_count, last_row_start = 0;
int this_row;
struct zint_vector *vector; struct zint_vector *vector;
struct zint_vector_rect *rectangle, *rect, *last_rectangle = NULL; struct zint_vector_rect *rect, *last_rectangle = NULL;
struct zint_vector_hexagon *last_hexagon = NULL; struct zint_vector_hexagon *hexagon, *last_hexagon = NULL;
struct zint_vector_string *last_string = NULL; struct zint_vector_string *last_string = NULL;
struct zint_vector_circle *last_circle = NULL; struct zint_vector_circle *circle, *last_circle = NULL;
// Free any previous rendering structures // Free any previous rendering structures
vector_free(symbol); vector_free(symbol);
@ -433,7 +436,10 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
// Allocate memory // Allocate memory
vector = symbol->vector = (struct zint_vector *) malloc(sizeof(struct zint_vector)); vector = symbol->vector = (struct zint_vector *) malloc(sizeof(struct zint_vector));
if (!vector) return ZINT_ERROR_MEMORY; if (!vector) {
strcpy(symbol->errtxt, "696: Insufficient memory for vector header");
return ZINT_ERROR_MEMORY;
}
vector->rectangles = NULL; vector->rectangles = NULL;
vector->hexagons = NULL; vector->hexagons = NULL;
vector->circles = NULL; vector->circles = NULL;
@ -444,10 +450,11 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
main_width = symbol->width; main_width = symbol->width;
if (is_extendable(symbol->symbology)) { if (is_extendable(symbol->symbology)) {
upceanflag = output_process_upcean(symbol, &main_width, &comp_offset, addon, &addon_gap); upceanflag = output_process_upcean(symbol, &main_width, &comp_xoffset, addon, &addon_gap);
} }
output_set_whitespace_offsets(symbol, &xoffset, &yoffset, &roffset, &boffset); output_set_whitespace_offsets(symbol, &xoffset, &yoffset, &roffset, &boffset, 0 /*scaler*/,
NULL, NULL, NULL, NULL);
/* Note font sizes scaled by 2 so really twice these values */ /* Note font sizes scaled by 2 so really twice these values */
if (upceanflag) { if (upceanflag) {
@ -456,18 +463,22 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
upcae_outside_text_height = symbol->output_options & SMALL_TEXT ? 6 : 7; upcae_outside_text_height = symbol->output_options & SMALL_TEXT ? 6 : 7;
/* Negative to move close to barcode (less digit ascent, then add 0.5X) */ /* Negative to move close to barcode (less digit ascent, then add 0.5X) */
text_gap = -text_height * digit_ascent_factor + 0.5f; text_gap = -text_height * digit_ascent_factor + 0.5f;
/* Guard bar height (none for EAN-2 and EAN-5) */
guard_height = upceanflag != 2 && upceanflag != 5 ? 5.0f : 0.0f; /* TODO: use zint_symbol field */
} else { } else {
text_height = symbol->output_options & SMALL_TEXT ? 6 : 7; text_height = symbol->output_options & SMALL_TEXT ? 6 : 7;
text_gap = text_height * 0.1f; text_gap = text_height * 0.1f;
guard_height = 0.0f;
} }
hide_text = ((!symbol->show_hrt) || (ustrlen(symbol->text) == 0)); hide_text = ((!symbol->show_hrt) || (ustrlen(symbol->text) == 0));
if (hide_text) { if (hide_text) {
textoffset = upceanflag && upceanflag != 2 && upceanflag != 5 ? 5.0f : 0.0f; /* Allow for guard bars */ textoffset = guard_height;
} else { } else {
if (upceanflag) { if (upceanflag) {
textoffset = text_height + 0.2f + text_gap; /* Add fudge for anti-aliasing of digits */ /* Add fudge for anti-aliasing of digits */
textoffset = (text_height > guard_height ? text_height : guard_height) + 0.2f + text_gap;
} else { } else {
textoffset = text_height * 1.25f + text_gap; /* Allow +25% for characters descending below baseline */ textoffset = text_height * 1.25f + text_gap; /* Allow +25% for characters descending below baseline */
} }
@ -487,16 +498,8 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
vector->width = symbol->width + dot_overspill + (xoffset + roffset); vector->width = symbol->width + dot_overspill + (xoffset + roffset);
vector->height = symbol->height + textoffset + dot_overspill + (yoffset + boffset); vector->height = symbol->height + textoffset + dot_overspill + (yoffset + boffset);
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))) {
default_text_posn = symbol->height + text_height + text_gap + symbol->whitespace_height
+ symbol->border_width * 2;
} else {
default_text_posn = symbol->height + text_height + text_gap + symbol->whitespace_height;
}
// Plot Maxicode symbols // Plot Maxicode symbols
if (symbol->symbology == BARCODE_MAXICODE) { if (symbol->symbology == BARCODE_MAXICODE) {
struct zint_vector_circle *circle;
float bull_x, bull_y, bull_d_incr, bull_width; float bull_x, bull_y, bull_d_incr, bull_width;
const float two_div_sqrt3 = 1.1547f; /* 2 / √3 */ const float two_div_sqrt3 = 1.1547f; /* 2 / √3 */
const float sqrt3_div_two = 0.866f; /* √3 / 2 == 1.5 / √3 */ const float sqrt3_div_two = 0.866f; /* √3 / 2 == 1.5 / √3 */
@ -519,13 +522,17 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
bull_d_incr = (hex_diameter * 9 - hex_ydiameter) / 5.0f; bull_d_incr = (hex_diameter * 9 - hex_ydiameter) / 5.0f;
bull_width = bull_d_incr / 2.0f; bull_width = bull_d_incr / 2.0f;
circle = vector_plot_create_circle(bull_x, bull_y, hex_ydiameter + bull_d_incr * 5 - bull_width, bull_width, circle = vector_plot_create_circle(symbol, bull_x, bull_y,
0); hex_ydiameter + bull_d_incr * 5 - bull_width, bull_width, 0);
if (!circle) return ZINT_ERROR_MEMORY;
vector_plot_add_circle(symbol, circle, &last_circle); vector_plot_add_circle(symbol, circle, &last_circle);
circle = vector_plot_create_circle(bull_x, bull_y, hex_ydiameter + bull_d_incr * 3 - bull_width, bull_width, circle = vector_plot_create_circle(symbol, bull_x, bull_y,
0); hex_ydiameter + bull_d_incr * 3 - bull_width, bull_width, 0);
if (!circle) return ZINT_ERROR_MEMORY;
vector_plot_add_circle(symbol, circle, &last_circle); vector_plot_add_circle(symbol, circle, &last_circle);
circle = vector_plot_create_circle(bull_x, bull_y, hex_ydiameter + bull_d_incr - bull_width, bull_width, 0); circle = vector_plot_create_circle(symbol, bull_x, bull_y,
hex_ydiameter + bull_d_incr - bull_width, bull_width, 0);
if (!circle) return ZINT_ERROR_MEMORY;
vector_plot_add_circle(symbol, circle, &last_circle); vector_plot_add_circle(symbol, circle, &last_circle);
/* Hexagons */ /* Hexagons */
@ -536,7 +543,8 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
for (i = 0; i < symbol->width - odd_row; i++) { for (i = 0; i < symbol->width - odd_row; i++) {
if (module_is_set(symbol, r, i)) { if (module_is_set(symbol, r, i)) {
const float xposn = i * hex_diameter + xposn_offset; const float xposn = i * hex_diameter + xposn_offset;
struct zint_vector_hexagon *hexagon = vector_plot_create_hexagon(xposn, yposn, hex_diameter); hexagon = vector_plot_create_hexagon(symbol, xposn, yposn, hex_diameter);
if (!hexagon) return ZINT_ERROR_MEMORY;
vector_plot_add_hexagon(symbol, hexagon, &last_hexagon); vector_plot_add_hexagon(symbol, hexagon, &last_hexagon);
} }
} }
@ -546,10 +554,9 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
for (r = 0; r < symbol->rows; r++) { for (r = 0; r < symbol->rows; r++) {
for (i = 0; i < symbol->width; i++) { for (i = 0; i < symbol->width; i++) {
if (module_is_set(symbol, r, i)) { if (module_is_set(symbol, r, i)) {
struct zint_vector_circle *circle = vector_plot_create_circle( circle = vector_plot_create_circle(symbol, i + dot_offset + xoffset, r + dot_offset + yoffset,
i + dot_offset + xoffset,
r + dot_offset + yoffset,
symbol->dot_size, 0, 0); symbol->dot_size, 0, 0);
if (!circle) return ZINT_ERROR_MEMORY;
vector_plot_add_circle(symbol, circle, &last_circle); vector_plot_add_circle(symbol, circle, &last_circle);
} }
} }
@ -557,27 +564,27 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
// Plot rectangles - most symbols created here // Plot rectangles - most symbols created here
} else { } else {
rect_count = 0; rect_count = 0;
row_posn = yoffset; yposn = yoffset;
for (r = 0; r < symbol->rows; r++) { for (r = 0; r < symbol->rows; r++) {
this_row = r; float row_height = symbol->row_height[r] ? symbol->row_height[r] : large_bar_height;
last_row_start = rect_count; last_row_start = rect_count;
row_height = symbol->row_height[this_row] ? symbol->row_height[this_row] : large_bar_height;
i = 0; i = 0;
if (symbol->symbology == BARCODE_ULTRA) { if (symbol->symbology == BARCODE_ULTRA) {
do { do {
int module_fill = module_colour_is_set(symbol, this_row, i); int module_fill = module_colour_is_set(symbol, r, i);
int block_width = 0; int block_width = 0;
do { do {
block_width++; block_width++;
} while (i + block_width < symbol->width } while (i + block_width < symbol->width
&& module_colour_is_set(symbol, this_row, i + block_width) == module_fill); && module_colour_is_set(symbol, r, i + block_width) == module_fill);
if (module_fill) { if (module_fill) {
/* a colour block */ /* a colour block */
rectangle = vector_plot_create_rect(i + xoffset, row_posn, block_width, row_height); rect = vector_plot_create_rect(symbol, i + xoffset, yposn, block_width, row_height);
rectangle->colour = module_colour_is_set(symbol, this_row, i); if (!rect) return ZINT_ERROR_MEMORY;
vector_plot_add_rect(symbol, rectangle, &last_rectangle); rect->colour = module_colour_is_set(symbol, r, i);
vector_plot_add_rect(symbol, rect, &last_rectangle);
rect_count++; rect_count++;
} }
i += block_width; i += block_width;
@ -585,43 +592,45 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
} while (i < symbol->width); } while (i < symbol->width);
} else { } else {
do { do {
int module_fill = module_is_set(symbol, this_row, i); float addon_row_height;
int module_fill = module_is_set(symbol, r, i);
int block_width = 0; int block_width = 0;
do { do {
block_width++; block_width++;
} while (i + block_width < symbol->width } while (i + block_width < symbol->width
&& module_is_set(symbol, this_row, i + block_width) == module_fill); && module_is_set(symbol, r, i + block_width) == module_fill);
if (upceanflag && (addon_latch == 0) && (r == (symbol->rows - 1)) && (i > main_width)) { if (upceanflag && (addon_latch == 0) && (r == (symbol->rows - 1)) && (i > main_width)) {
addon_text_posn = row_posn + text_height - text_height * digit_ascent_factor; addon_text_yposn = yposn + text_height - text_height * digit_ascent_factor;
if (addon_text_posn < 0.0f) { if (addon_text_yposn < 0.0f) {
addon_text_posn = 0.0f; addon_text_yposn = 0.0f;
} }
addon_bar_height = row_height - (addon_text_posn - row_posn) + text_gap; addon_row_height = row_height - (addon_text_yposn - yposn) + text_gap;
if (upceanflag != 12 && upceanflag != 6) { /* UPC-A/E don't descend */ if (upceanflag != 12 && upceanflag != 6) { /* UPC-A/E add-ons don't descend */
addon_bar_height += 5.0f; addon_row_height += guard_height;
} }
if (addon_bar_height < 0.5f) { if (addon_row_height < 0.5f) {
addon_bar_height = 0.5f; addon_row_height = 0.5f;
} }
addon_latch = 1; addon_latch = 1;
} }
if (module_fill) { if (module_fill) {
/* a bar */ /* a bar */
if (addon_latch == 0) { if (addon_latch == 0) {
rectangle = vector_plot_create_rect(i + xoffset, row_posn, block_width, row_height); rect = vector_plot_create_rect(symbol, i + xoffset, yposn, block_width, row_height);
} else { } else {
rectangle = vector_plot_create_rect(i + xoffset, addon_text_posn - text_gap, block_width, rect = vector_plot_create_rect(symbol, i + xoffset, addon_text_yposn - text_gap,
addon_bar_height); block_width, addon_row_height);
} }
vector_plot_add_rect(symbol, rectangle, &last_rectangle); if (!rect) return ZINT_ERROR_MEMORY;
vector_plot_add_rect(symbol, rect, &last_rectangle);
rect_count++; rect_count++;
} }
i += block_width; i += block_width;
} while (i < symbol->width); } while (i < symbol->width);
} }
yposn += row_height;
row_posn += row_height;
} }
} }
@ -636,7 +645,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
case 14: case 14:
case 15: case 15:
case 16: case 16:
rect->height += 5.0f; rect->height += guard_height;
break; break;
} }
i++; i++;
@ -651,7 +660,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
case 11: case 11:
case 20: case 20:
case 21: case 21:
rect->height += 5.0f; rect->height += guard_height;
break; break;
} }
i++; i++;
@ -670,7 +679,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
case 27: case 27:
case 28: case 28:
case 29: case 29:
rect->height += 5.0f; rect->height += guard_height;
break; break;
} }
i++; i++;
@ -685,7 +694,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
case 15: case 15:
case 28: case 28:
case 29: case 29:
rect->height += 5.0f; rect->height += guard_height;
break; break;
} }
i++; i++;
@ -696,8 +705,16 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
/* Add the text */ /* Add the text */
if (!hide_text) { if (!hide_text) {
int textdone = 0;
float text_xposn;
float text_yposn;
xoffset += comp_offset; xoffset += comp_xoffset;
text_yposn = yoffset + symbol->height + text_height + text_gap; /* Calculated to bottom of text */
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))) {
text_yposn += symbol->border_width;
}
if (upceanflag) { if (upceanflag) {
float textwidth; float textwidth;
@ -705,115 +722,115 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
output_upcean_split_text(upceanflag, symbol->text, textpart1, textpart2, textpart3, textpart4); output_upcean_split_text(upceanflag, symbol->text, textpart1, textpart2, textpart3, textpart4);
if (upceanflag == 6) { /* UPC-E */ if (upceanflag == 6) { /* UPC-E */
textpos = -5.0f + xoffset; text_xposn = -5.0f + xoffset;
textwidth = 6.2f; textwidth = 6.2f;
vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, upcae_outside_text_height, if (!vector_plot_add_string(symbol, textpart1, text_xposn, text_yposn, upcae_outside_text_height,
textwidth, 2 /*right align*/, &last_string); textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
textpos = 24.0f + xoffset; text_xposn = 24.0f + xoffset;
textwidth = 6.0f * 8.5f; textwidth = 6.0f * 8.5f;
vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, textpart2, text_xposn, text_yposn, text_height,
&last_string); textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
textpos = 51.0f + 3.0f + xoffset; text_xposn = 51.0f + 3.0f + xoffset;
textwidth = 6.2f; textwidth = 6.2f;
vector_plot_add_string(symbol, textpart3, textpos, default_text_posn, upcae_outside_text_height, if (!vector_plot_add_string(symbol, textpart3, text_xposn, text_yposn, upcae_outside_text_height,
textwidth, 1 /*left align*/, &last_string); textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
textdone = 1; textdone = 1;
switch (ustrlen(addon)) { switch (ustrlen(addon)) {
case 2: case 2:
textpos = 61.0f + xoffset + addon_gap; text_xposn = 61.0f + xoffset + addon_gap;
textwidth = 2.0f * 8.5f; textwidth = 2.0f * 8.5f;
vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, addon, text_xposn, addon_text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
break; break;
case 5: case 5:
textpos = 75.0f + xoffset + addon_gap; text_xposn = 75.0f + xoffset + addon_gap;
textwidth = 5.0f * 8.5f; textwidth = 5.0f * 8.5f;
vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, addon, text_xposn, addon_text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
break; break;
} }
} else if (upceanflag == 8) { /* EAN-8 */ } else if (upceanflag == 8) { /* EAN-8 */
textpos = 17.0f + xoffset; text_xposn = 17.0f + xoffset;
textwidth = 4.0f * 8.5f; textwidth = 4.0f * 8.5f;
vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, textpart1, text_xposn, text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
textpos = 50.0f + xoffset; text_xposn = 50.0f + xoffset;
vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, textpart2, text_xposn, text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
textdone = 1; textdone = 1;
switch (ustrlen(addon)) { switch (ustrlen(addon)) {
case 2: case 2:
textpos = 77.0f + xoffset + addon_gap; text_xposn = 77.0f + xoffset + addon_gap;
textwidth = 2.0f * 8.5f; textwidth = 2.0f * 8.5f;
vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, addon, text_xposn, addon_text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
break; break;
case 5: case 5:
textpos = 91.0f + xoffset + addon_gap; text_xposn = 91.0f + xoffset + addon_gap;
textwidth = 5.0f * 8.5f; textwidth = 5.0f * 8.5f;
vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, addon, text_xposn, addon_text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
break; break;
} }
} else if (upceanflag == 12) { /* UPC-A */ } else if (upceanflag == 12) { /* UPC-A */
textpos = -5.0f + xoffset; text_xposn = -5.0f + xoffset;
textwidth = 6.2f; textwidth = 6.2f;
vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, upcae_outside_text_height, if (!vector_plot_add_string(symbol, textpart1, text_xposn, text_yposn, upcae_outside_text_height,
textwidth, 2 /*right align*/, &last_string); textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
textpos = 27.0f + xoffset; text_xposn = 27.0f + xoffset;
textwidth = 5.0f * 8.5f; textwidth = 5.0f * 8.5f;
vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, textpart2, text_xposn, text_yposn, text_height,
&last_string); textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
textpos = 67.0f + xoffset; text_xposn = 67.0f + xoffset;
vector_plot_add_string(symbol, textpart3, textpos, default_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, textpart3, text_xposn, text_yposn, text_height,
&last_string); textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
textpos = 95.0f + 5.0f + xoffset; text_xposn = 95.0f + 5.0f + xoffset;
textwidth = 6.2f; textwidth = 6.2f;
vector_plot_add_string(symbol, textpart4, textpos, default_text_posn, upcae_outside_text_height, if (!vector_plot_add_string(symbol, textpart4, text_xposn, text_yposn, upcae_outside_text_height,
textwidth, 1 /*left align*/, &last_string); textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
textdone = 1; textdone = 1;
switch (ustrlen(addon)) { switch (ustrlen(addon)) {
case 2: case 2:
textpos = 105.0f + xoffset + addon_gap; text_xposn = 105.0f + xoffset + addon_gap;
textwidth = 2.0f * 8.5f; textwidth = 2.0f * 8.5f;
vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, addon, text_xposn, addon_text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
break; break;
case 5: case 5:
textpos = 119.0f + xoffset + addon_gap; text_xposn = 119.0f + xoffset + addon_gap;
textwidth = 5.0f * 8.5f; textwidth = 5.0f * 8.5f;
vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, addon, text_xposn, addon_text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
break; break;
} }
} else if (upceanflag == 13) { /* EAN-13 */ } else if (upceanflag == 13) { /* EAN-13 */
textpos = -5.0f + xoffset; text_xposn = -5.0f + xoffset;
textwidth = 8.5f; textwidth = 8.5f;
vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, text_height, textwidth, if (!vector_plot_add_string(symbol, textpart1, text_xposn, text_yposn,
2 /*right align*/, &last_string); text_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
textpos = 24.0f + xoffset; text_xposn = 24.0f + xoffset;
textwidth = 6.0f * 8.5f; textwidth = 6.0f * 8.5f;
vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, textpart2, text_xposn, text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
textpos = 71.0f + xoffset; text_xposn = 71.0f + xoffset;
vector_plot_add_string(symbol, textpart3, textpos, default_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, textpart3, text_xposn, text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
textdone = 1; textdone = 1;
switch (ustrlen(addon)) { switch (ustrlen(addon)) {
case 2: case 2:
textpos = 105.0f + xoffset + addon_gap; text_xposn = 105.0f + xoffset + addon_gap;
textwidth = 2.0f * 8.5f; textwidth = 2.0f * 8.5f;
vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, addon, text_xposn, addon_text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
break; break;
case 5: case 5:
textpos = 119.0f + xoffset + addon_gap; text_xposn = 119.0f + xoffset + addon_gap;
textwidth = 5.0f * 8.5f; textwidth = 5.0f * 8.5f;
vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, if (!vector_plot_add_string(symbol, addon, text_xposn, addon_text_yposn,
&last_string); text_height, textwidth, 0, &last_string)) return ZINT_ERROR_MEMORY;
break; break;
} }
} }
@ -822,70 +839,76 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
if (!textdone) { if (!textdone) {
/* Put normal human readable text at the bottom (and centered) */ /* Put normal human readable text at the bottom (and centered) */
// calculate start xoffset to center text // calculate start xoffset to center text
vector_plot_add_string(symbol, symbol->text, main_width / 2.0f + xoffset, default_text_posn, text_height, text_xposn = main_width / 2.0f + xoffset;
symbol->width, 0, &last_string); if (!vector_plot_add_string(symbol, symbol->text, text_xposn, text_yposn,
text_height, symbol->width, 0, &last_string)) return ZINT_ERROR_MEMORY;
} }
xoffset -= comp_offset; // Restore xoffset xoffset -= comp_xoffset; // Restore xoffset
} }
// Binding and boxes // Separator binding for stacked barcodes
if (symbol->output_options & BARCODE_BIND) { if ((symbol->output_options & BARCODE_BIND) && (symbol->rows > 1) && is_stackable(symbol->symbology)) {
if ((symbol->rows > 1) && (is_stackable(symbol->symbology) == 1)) { float sep_xoffset = xoffset;
float sep_height = 1.0f; float sep_width = symbol->width;
float sep_height = 1.0f, sep_yoffset;
if (symbol->option_3 > 0 && symbol->option_3 <= 4) { if (symbol->option_3 > 0 && symbol->option_3 <= 4) {
sep_height = symbol->option_3; sep_height = symbol->option_3;
} }
/* row binding */ sep_yoffset = yoffset - sep_height / 2;
if (symbol->symbology != BARCODE_CODABLOCKF && symbol->symbology != BARCODE_HIBC_BLOCKF) { if (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF) {
for (r = 1; r < symbol->rows; r++) {
row_height = symbol->row_height[r - 1] ? symbol->row_height[r - 1] : large_bar_height;
rectangle = vector_plot_create_rect(xoffset, (r * row_height) + yoffset - sep_height / 2,
symbol->width, sep_height);
vector_plot_add_rect(symbol, rectangle, &last_rectangle);
}
} else {
for (r = 1; r < symbol->rows; r++) {
/* Avoid 11-module start and 13-module stop chars */ /* Avoid 11-module start and 13-module stop chars */
row_height = symbol->row_height[r - 1] ? symbol->row_height[r - 1] : large_bar_height; sep_xoffset += 11;
rectangle = vector_plot_create_rect(xoffset + 11, (r * row_height) + yoffset - sep_height / 2, sep_width -= 11 + 13;
symbol->width - 24, sep_height); }
vector_plot_add_rect(symbol, rectangle, &last_rectangle); for (r = 1; r < symbol->rows; r++) {
} float row_height = symbol->row_height[r - 1] ? symbol->row_height[r - 1] : large_bar_height;
} rect = vector_plot_create_rect(symbol, sep_xoffset, (r * row_height) + sep_yoffset,
sep_width, sep_height);
if (!rect) return ZINT_ERROR_MEMORY;
vector_plot_add_rect(symbol, rect, &last_rectangle);
} }
} }
// Bind/box
if (symbol->border_width > 0) { if (symbol->border_width > 0) {
if (symbol->output_options & (BARCODE_BOX | BARCODE_BIND)) { if (symbol->output_options & (BARCODE_BOX | BARCODE_BIND)) {
float ybind_bottom = vector->height - symbol->border_width - textoffset - symbol->whitespace_height; const float ybind_top = yoffset - symbol->border_width;
// Following equivalent to yoffset + symbol->height + dot_overspill except for BARCODE_MAXICODE
const float ybind_bot = vector->height - textoffset - boffset;
// Top // Top
rectangle = vector_plot_create_rect(0.0f, symbol->whitespace_height, vector->width, symbol->border_width); rect = vector_plot_create_rect(symbol, 0.0f, ybind_top, vector->width, symbol->border_width);
if (!rect) return ZINT_ERROR_MEMORY;
if (!(symbol->output_options & BARCODE_BOX) if (!(symbol->output_options & BARCODE_BOX)
&& (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF)) { && (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF)) {
/* CodaBlockF bind - does not extend over horizontal whitespace */ /* CodaBlockF bind - does not extend over horizontal whitespace */
rectangle->x = xoffset; rect->x = xoffset;
rectangle->width -= (2.0f * xoffset); rect->width -= xoffset + roffset;
} }
vector_plot_add_rect(symbol, rectangle, &last_rectangle); vector_plot_add_rect(symbol, rect, &last_rectangle);
// Bottom // Bottom
rectangle = vector_plot_create_rect(0.0f, ybind_bottom, vector->width, symbol->border_width); rect = vector_plot_create_rect(symbol, 0.0f, ybind_bot, vector->width, symbol->border_width);
if (!rect) return ZINT_ERROR_MEMORY;
if (!(symbol->output_options & BARCODE_BOX) if (!(symbol->output_options & BARCODE_BOX)
&& (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF)) { && (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF)) {
/* CodaBlockF bind - does not extend over horizontal whitespace */ /* CodaBlockF bind - does not extend over horizontal whitespace */
rectangle->x = xoffset; rect->x = xoffset;
rectangle->width -= (2.0f * xoffset); rect->width -= xoffset + roffset;
} }
vector_plot_add_rect(symbol, rectangle, &last_rectangle); vector_plot_add_rect(symbol, rect, &last_rectangle);
} }
if (symbol->output_options & BARCODE_BOX) { if (symbol->output_options & BARCODE_BOX) {
float xbox_right = vector->width - symbol->border_width; float xbox_right = vector->width - symbol->border_width;
float box_height = vector->height - textoffset - (symbol->whitespace_height + symbol->border_width) * 2; // Following equivalent to symbol->height except for BARCODE_MAXICODE
float box_height = vector->height - textoffset - dot_overspill - yoffset - boffset;
// Left // Left
rectangle = vector_plot_create_rect(0.0f, yoffset, symbol->border_width, box_height); rect = vector_plot_create_rect(symbol, 0.0f, yoffset, symbol->border_width, box_height);
vector_plot_add_rect(symbol, rectangle, &last_rectangle); if (!rect) return ZINT_ERROR_MEMORY;
vector_plot_add_rect(symbol, rect, &last_rectangle);
// Right // Right
rectangle = vector_plot_create_rect(xbox_right, yoffset, symbol->border_width, box_height); rect = vector_plot_create_rect(symbol, xbox_right, yoffset, symbol->border_width, box_height);
vector_plot_add_rect(symbol, rectangle, &last_rectangle); if (!rect) return ZINT_ERROR_MEMORY;
vector_plot_add_rect(symbol, rect, &last_rectangle);
} }
} }

View File

@ -503,6 +503,8 @@ The minimum scale for raster output in dotty mode is 1 (see 4.14).
The minimum scale for vector output is 0.1, giving a minimum X-dimension of 0.2. The minimum scale for vector output is 0.1, giving a minimum X-dimension of 0.2.
The maximum scale for both raster and vector is 100.
4.9.1 Scaling example 4.9.1 Scaling example
--------------------- ---------------------
The GS1 General Specifications Section 5.2.6.6 "Symbol dimensions at nominal The GS1 General Specifications Section 5.2.6.6 "Symbol dimensions at nominal

View File

@ -521,7 +521,7 @@ static int batch_process(struct zint_symbol *symbol, const char *filename, const
} else { } else {
file = fopen(filename, "rb"); file = fopen(filename, "rb");
if (!file) { if (!file) {
strcpy(symbol->errtxt, "102: Unable to read input file"); sprintf(symbol->errtxt, "102: Unable to read input file '%s'", filename);
return ZINT_ERROR_INVALID_DATA; return ZINT_ERROR_INVALID_DATA;
} }
} }
@ -776,6 +776,7 @@ int main(int argc, char **argv) {
#else #else
arg_opt *arg_opts = (arg_opt *) _alloca(argc * sizeof(arg_opt)); arg_opt *arg_opts = (arg_opt *) _alloca(argc * sizeof(arg_opt));
#endif #endif
int no_getopt_error = 1;
if (argc == 1) { if (argc == 1) {
usage(); usage();
@ -794,7 +795,7 @@ int main(int argc, char **argv) {
win_args(&argc, &argv); win_args(&argc, &argv);
#endif #endif
while (1) { while (no_getopt_error) {
enum options { enum options {
OPT_ADDONGAP = 128, OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BOLD, OPT_BORDER, OPT_ADDONGAP = 128, OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BOLD, OPT_BORDER,
OPT_BOX, OPT_CMYK, OPT_COLS, OPT_DIRECT, OPT_DMRE, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP, OPT_BOX, OPT_CMYK, OPT_COLS, OPT_DIRECT, OPT_DMRE, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP,
@ -863,7 +864,7 @@ int main(int argc, char **argv) {
{"whitesp", 1, NULL, 'w'}, {"whitesp", 1, NULL, 'w'},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
int c = getopt_long(argc, argv, "b:d:ehi:o:rtw:", long_options, &option_index); int c = getopt_long_only(argc, argv, "b:d:ehi:o:rtw:", long_options, &option_index);
if (c == -1) break; if (c == -1) break;
switch (c) { switch (c) {
@ -1258,11 +1259,13 @@ int main(int argc, char **argv) {
break; break;
case '?': case '?':
no_getopt_error = 0;
break; break;
default: default: /* Shouldn't happen */
fprintf(stderr, "Error 123: ?? getopt error 0%o\n", c); fprintf(stderr, "Error 123: ?? getopt error 0%o\n", c); /* Not reached */
fflush(stderr); fflush(stderr);
no_getopt_error = 0;
break; break;
} }
} }

View File

@ -895,26 +895,27 @@ static void test_other_opts(int index, int debug) {
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
/* 0*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "" }, /* 0*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "" },
/* 1*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "" }, /* 1*/ { BARCODE_CODE128, "1", -1, " -bg=", "EF9900", "" },
/* 2*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 654: Malformed background colour target" }, /* 2*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "" },
/* 3*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "" }, /* 3*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 654: Malformed background colour target" },
/* 4*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "" }, /* 4*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "" },
/* 5*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 651: Malformed foreground colour target" }, /* 5*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "" },
/* 6*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 653: Malformed foreground colour target" }, /* 6*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 651: Malformed foreground colour target" },
/* 7*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "10", "" }, /* 7*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 653: Malformed foreground colour target" },
/* 8*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "101", "Warning 126: Font size out of range (0 to 100), ignoring" }, /* 8*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "10", "" },
/* 9*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "" }, /* 9*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "101", "Warning 126: Font size out of range (0 to 100), ignoring" },
/* 10*/ { BARCODE_CODE128, "1", -1, " --notext", "", "" }, /* 10*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "" },
/* 11*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "" }, /* 11*/ { BARCODE_CODE128, "1", -1, " --notext", "", "" },
/* 12*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "" }, /* 12*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "" },
/* 13*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported" }, /* 13*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "" },
/* 14*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "" }, /* 14*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported" },
/* 15*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI" }, /* 15*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "" },
/* 16*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI" }, /* 16*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI" },
/* 17*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "" }, /* 17*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI" },
/* 18*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'" }, /* 18*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "" },
/* 19*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "" }, /* 19*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'" },
/* 20*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'" }, /* 20*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "" },
/* 21*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'" },
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
int i; int i;

View File

@ -830,6 +830,9 @@ in X-dimensions</string>
<property name="suffix"> <property name="suffix">
<string> X</string> <string> X</string>
</property> </property>
<property name="maximum">
<number>100</number>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
@ -841,6 +844,9 @@ in X-dimensions</string>
<property name="suffix"> <property name="suffix">
<string> X</string> <string> X</string>
</property> </property>
<property name="maximum">
<number>100</number>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -876,7 +882,7 @@ in X-dimensions</string>
<double>0.100000000000000</double> <double>0.100000000000000</double>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>99.500000000000000</double> <double>100.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.500000000000000</double> <double>0.500000000000000</double>