mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-25 20:44:29 -04:00
Remove bitmap_byte_length
member from zint_symbol
(was only set on BMP output to length of BMP pixel array) EXCODE39: change to display check digit in HRT by default CODE39/EXCODE39/LOGMARS: new hidden check digit option (`option_2 = 2`) qr.c: suppress bogus gcc-13 warning (only appears on optimize) GUI: move some symbology-specific options into Data Tab so separate tab unnecessary (those with few options and no Composite/ECI), namely: all C25XXX, CODE39/EXCODE39/LOGMARS, MSI_PLESSEY, CODABAR, DAFT, DPD, MAILMARK_2D, ITF-14, PZN, UPNQR, CHANNEL, CODE93 and VIN, adjusting grp uis. change Data dialog button (ellipsis) QToolButton -> QPushButton & vice versa zap/clear/eye/swap/scale buttons QPushButton -> QToolButton for better mac compat (also makes sense); remove some mac hacks that no longer seem necessary; use folder icon for Export dialog directory button manual: document new Symbology-specific groupbox & CODE39/etc hidden check digit option; add annexes on Qt and Tcl backends; narrow some tables for better txt output; remove echoed image tags in txt (pandoc 3.1.5 regression?); add one-page HTML output to Makefile; also tex output (debug); add class attributes to images to aid HTML styling; various other fiddlings
This commit is contained in:
parent
d05373e7fc
commit
32c9e6a98e
56 changed files with 2419 additions and 1507 deletions
|
@ -122,8 +122,6 @@ INTERNAL int bmp_pixel_plot(struct zint_symbol *symbol, const unsigned char *pix
|
|||
}
|
||||
}
|
||||
|
||||
symbol->bitmap_byte_length = data_size;
|
||||
|
||||
file_header.header_field = 0x4d42; /* "BM" */
|
||||
file_header.file_size = file_size;
|
||||
file_header.reserved = 0;
|
||||
|
|
|
@ -248,7 +248,7 @@ INTERNAL int code39(struct zint_symbol *symbol, unsigned char source[], int leng
|
|||
|
||||
counter = 0;
|
||||
|
||||
if ((symbol->option_2 < 0) || (symbol->option_2 > 1)) {
|
||||
if ((symbol->option_2 < 0) || (symbol->option_2 > 2)) {
|
||||
symbol->option_2 = 0;
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ INTERNAL int code39(struct zint_symbol *symbol, unsigned char source[], int leng
|
|||
counter += posns[i];
|
||||
}
|
||||
|
||||
if (symbol->option_2 == 1) {
|
||||
if (symbol->option_2 == 1 || symbol->option_2 == 2) { /* Visible or hidden check digit */
|
||||
|
||||
char check_digit;
|
||||
counter %= 43;
|
||||
|
@ -294,8 +294,10 @@ INTERNAL int code39(struct zint_symbol *symbol, unsigned char source[], int leng
|
|||
check_digit = '_';
|
||||
}
|
||||
|
||||
localstr[0] = check_digit;
|
||||
localstr[1] = '\0';
|
||||
if (symbol->option_2 == 1) { /* Visible check digit */
|
||||
localstr[0] = check_digit;
|
||||
localstr[1] = '\0';
|
||||
}
|
||||
if (symbol->debug & ZINT_DEBUG_PRINT) printf("Check digit: %c\n", check_digit);
|
||||
}
|
||||
|
||||
|
@ -442,6 +444,7 @@ INTERNAL int excode39(struct zint_symbol *symbol, unsigned char source[], int le
|
|||
|
||||
unsigned char buffer[85 * 2 + 1] = {0};
|
||||
unsigned char *b = buffer;
|
||||
unsigned char check_digit = '\0';
|
||||
int i;
|
||||
int error_number;
|
||||
|
||||
|
@ -469,9 +472,22 @@ INTERNAL int excode39(struct zint_symbol *symbol, unsigned char source[], int le
|
|||
/* Then sends the buffer to the C39 function */
|
||||
error_number = code39(symbol, buffer, b - buffer);
|
||||
|
||||
/* Save visible check digit */
|
||||
if (symbol->option_2 == 1) {
|
||||
const int len = (int) ustrlen(symbol->text);
|
||||
if (len > 0) {
|
||||
check_digit = symbol->text[len - 1];
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy over source to HRT, subbing space for unprintables */
|
||||
for (i = 0; i < length; i++)
|
||||
symbol->text[i] = source[i] >= ' ' && source[i] != 0x7F ? source[i] : ' ';
|
||||
symbol->text[length] = '\0'; /* Chops off check digit */
|
||||
|
||||
if (check_digit) {
|
||||
symbol->text[i++] = check_digit;
|
||||
}
|
||||
symbol->text[i] = '\0';
|
||||
|
||||
return error_number;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,6 @@ void ZBarcode_Clear(struct zint_symbol *symbol) {
|
|||
}
|
||||
symbol->bitmap_width = 0;
|
||||
symbol->bitmap_height = 0;
|
||||
symbol->bitmap_byte_length = 0;
|
||||
|
||||
/* If there is a rendered version, ensure its memory is released */
|
||||
vector_free(symbol);
|
||||
|
|
10
backend/qr.c
10
backend/qr.c
|
@ -871,6 +871,12 @@ static void qr_place_align(unsigned char grid[], const int size, int x, int y) {
|
|||
static void qr_setup_grid(unsigned char *grid, const int size, const int version) {
|
||||
int i, toggle = 1;
|
||||
|
||||
/* Suppress false positive gcc-13 warning (when optimizing only) "writing 1 byte into a region of size 0" */
|
||||
#if defined(__GNUC__) && __GNUC__ == 13
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
|
||||
/* Add timing patterns */
|
||||
for (i = 0; i < size; i++) {
|
||||
if (toggle == 1) {
|
||||
|
@ -902,6 +908,10 @@ static void qr_setup_grid(unsigned char *grid, const int size, const int version
|
|||
grid[(7 * size) + (size - 8)] = 0x10;
|
||||
grid[((size - 8) * size) + 7] = 0x10;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 13
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/* Add alignment patterns */
|
||||
if (version != 1) {
|
||||
/* Version 1 does not have alignment patterns */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2020-2022 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2020-2023 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
@ -124,35 +124,43 @@ static void test_hrt(const testCtx *const p_ctx) {
|
|||
/* 2*/ { BARCODE_CODE11, 2, "123-45", -1, "123-45" }, /* No checksums */
|
||||
/* 3*/ { BARCODE_CODE11, -1, "123456789012", -1, "123456789012-8" }, /* First check digit 10 (A) goes to hyphen */
|
||||
/* 4*/ { BARCODE_CODE39, -1, "ABC1234", -1, "*ABC1234*" },
|
||||
/* 5*/ { BARCODE_CODE39, -1, "abc1234", -1, "*ABC1234*" }, /* Converts to upper */
|
||||
/* 6*/ { BARCODE_CODE39, -1, "123456789", -1, "*123456789*" },
|
||||
/* 7*/ { BARCODE_CODE39, 1, "123456789", -1, "*1234567892*" }, /* With check digit */
|
||||
/* 8*/ { BARCODE_EXCODE39, -1, "ABC1234", -1, "ABC1234" },
|
||||
/* 9*/ { BARCODE_EXCODE39, -1, "abc1234", -1, "abc1234" },
|
||||
/* 10*/ { BARCODE_EXCODE39, 1, "abc1234", -1, "abc1234" }, /* With check digit (not displayed) */
|
||||
/* 11*/ { BARCODE_EXCODE39, -1, "a%\000\001$\177z\033\037!+/\\@A~", 16, "a% $ z !+/\\@A~" }, /* NUL, ctrls and DEL replaced with spaces */
|
||||
/* 12*/ { BARCODE_LOGMARS, -1, "ABC1234", -1, "ABC1234" },
|
||||
/* 13*/ { BARCODE_LOGMARS, -1, "abc1234", -1, "ABC1234" }, /* Converts to upper */
|
||||
/* 14*/ { BARCODE_LOGMARS, 1, "abc1234", -1, "ABC12340" }, /* With check digit */
|
||||
/* 15*/ { BARCODE_LOGMARS, 1, "12345/ABCDE", -1, "12345/ABCDET" }, /* With check digit */
|
||||
/* 16*/ { BARCODE_CODE93, -1, "ABC1234", -1, "ABC1234" }, /* No longer shows 2 check chars added (same as BWIPP and TEC-IT) */
|
||||
/* 17*/ { BARCODE_CODE93, 1, "ABC1234", -1, "ABC1234S5" }, /* Unless requested */
|
||||
/* 18*/ { BARCODE_CODE93, -1, "abc1234", -1, "abc1234" },
|
||||
/* 19*/ { BARCODE_CODE93, 1, "abc1234", -1, "abc1234ZG" },
|
||||
/* 20*/ { BARCODE_CODE93, -1, "A\001a\000b\177d\037e", 9, "A a b d e" }, /* NUL, ctrls and DEL replaced with spaces */
|
||||
/* 21*/ { BARCODE_PZN, -1, "12345", -1, "PZN - 00123458" }, /* Pads with zeroes if length < 7 */
|
||||
/* 22*/ { BARCODE_PZN, -1, "123456", -1, "PZN - 01234562" },
|
||||
/* 23*/ { BARCODE_PZN, -1, "1234567", -1, "PZN - 12345678" },
|
||||
/* 24*/ { BARCODE_PZN, -1, "12345678", -1, "PZN - 12345678" },
|
||||
/* 25*/ { BARCODE_PZN, 1, "1234", -1, "PZN - 0012345" }, /* PZN7, pads with zeroes if length < 6 */
|
||||
/* 26*/ { BARCODE_PZN, 1, "12345", -1, "PZN - 0123458" },
|
||||
/* 27*/ { BARCODE_PZN, 1, "123456", -1, "PZN - 1234562" },
|
||||
/* 28*/ { BARCODE_PZN, 1, "1234562", -1, "PZN - 1234562" },
|
||||
/* 29*/ { BARCODE_VIN, -1, "1FTCR10UXTPA78180", -1, "1FTCR10UXTPA78180" },
|
||||
/* 30*/ { BARCODE_VIN, 1, "2FTPX28L0XCA15511", -1, "2FTPX28L0XCA15511" }, /* Include Import char - no change */
|
||||
/* 31*/ { BARCODE_HIBC_39, -1, "ABC1234", -1, "*+ABC1234+*" },
|
||||
/* 32*/ { BARCODE_HIBC_39, -1, "abc1234", -1, "*+ABC1234+*" }, /* Converts to upper */
|
||||
/* 33*/ { BARCODE_HIBC_39, -1, "123456789", -1, "*+1234567890*" },
|
||||
/* 5*/ { BARCODE_CODE39, 1, "ABC1234", -1, "*ABC12340*" }, /* With visible check digit */
|
||||
/* 6*/ { BARCODE_CODE39, -1, "abc1234", -1, "*ABC1234*" }, /* Converts to upper */
|
||||
/* 7*/ { BARCODE_CODE39, 1, "abc1234", -1, "*ABC12340*" }, /* Converts to upper */
|
||||
/* 8*/ { BARCODE_CODE39, -1, "123456789", -1, "*123456789*" },
|
||||
/* 9*/ { BARCODE_CODE39, 1, "123456789", -1, "*1234567892*" }, /* With visible check digit */
|
||||
/* 10*/ { BARCODE_CODE39, 2, "123456789", -1, "*123456789*" }, /* With hidden check digit */
|
||||
/* 11*/ { BARCODE_EXCODE39, -1, "ABC1234", -1, "ABC1234" },
|
||||
/* 12*/ { BARCODE_EXCODE39, 1, "ABC1234", -1, "ABC12340" }, /* With visible check digit */
|
||||
/* 13*/ { BARCODE_EXCODE39, -1, "abc1234", -1, "abc1234" },
|
||||
/* 14*/ { BARCODE_EXCODE39, 1, "abc1234", -1, "abc1234." }, /* With visible check digit (previously was hidden) */
|
||||
/* 15*/ { BARCODE_EXCODE39, 2, "abc1234", -1, "abc1234" }, /* With hidden check digit */
|
||||
/* 16*/ { BARCODE_EXCODE39, -1, "a%\000\001$\177z\033\037!+/\\@A~", 16, "a% $ z !+/\\@A~" }, /* NUL, ctrls and DEL replaced with spaces */
|
||||
/* 17*/ { BARCODE_EXCODE39, 1, "a%\000\001$\177z\033\037!+/\\@A~", 16, "a% $ z !+/\\@A~L" }, /* With visible check digit */
|
||||
/* 18*/ { BARCODE_EXCODE39, 2, "a%\000\001$\177z\033\037!+/\\@A~", 16, "a% $ z !+/\\@A~" }, /* With hidden check digit */
|
||||
/* 19*/ { BARCODE_LOGMARS, -1, "ABC1234", -1, "ABC1234" },
|
||||
/* 20*/ { BARCODE_LOGMARS, -1, "abc1234", -1, "ABC1234" }, /* Converts to upper */
|
||||
/* 21*/ { BARCODE_LOGMARS, 1, "abc1234", -1, "ABC12340" }, /* With check digit */
|
||||
/* 22*/ { BARCODE_LOGMARS, 1, "12345/ABCDE", -1, "12345/ABCDET" }, /* With visible check digit */
|
||||
/* 23*/ { BARCODE_LOGMARS, 2, "12345/ABCDE", -1, "12345/ABCDE" }, /* With hidden check digit */
|
||||
/* 24*/ { BARCODE_CODE93, -1, "ABC1234", -1, "ABC1234" }, /* No longer shows 2 check chars added (same as BWIPP and TEC-IT) */
|
||||
/* 25*/ { BARCODE_CODE93, 1, "ABC1234", -1, "ABC1234S5" }, /* Unless requested */
|
||||
/* 26*/ { BARCODE_CODE93, -1, "abc1234", -1, "abc1234" },
|
||||
/* 27*/ { BARCODE_CODE93, 1, "abc1234", -1, "abc1234ZG" },
|
||||
/* 28*/ { BARCODE_CODE93, -1, "A\001a\000b\177d\037e", 9, "A a b d e" }, /* NUL, ctrls and DEL replaced with spaces */
|
||||
/* 29*/ { BARCODE_PZN, -1, "12345", -1, "PZN - 00123458" }, /* Pads with zeroes if length < 7 */
|
||||
/* 30*/ { BARCODE_PZN, -1, "123456", -1, "PZN - 01234562" },
|
||||
/* 31*/ { BARCODE_PZN, -1, "1234567", -1, "PZN - 12345678" },
|
||||
/* 32*/ { BARCODE_PZN, -1, "12345678", -1, "PZN - 12345678" },
|
||||
/* 33*/ { BARCODE_PZN, 1, "1234", -1, "PZN - 0012345" }, /* PZN7, pads with zeroes if length < 6 */
|
||||
/* 34*/ { BARCODE_PZN, 1, "12345", -1, "PZN - 0123458" },
|
||||
/* 35*/ { BARCODE_PZN, 1, "123456", -1, "PZN - 1234562" },
|
||||
/* 36*/ { BARCODE_PZN, 1, "1234562", -1, "PZN - 1234562" },
|
||||
/* 37*/ { BARCODE_VIN, -1, "1FTCR10UXTPA78180", -1, "1FTCR10UXTPA78180" },
|
||||
/* 38*/ { BARCODE_VIN, 1, "2FTPX28L0XCA15511", -1, "2FTPX28L0XCA15511" }, /* Include Import char - no change */
|
||||
/* 39*/ { BARCODE_HIBC_39, -1, "ABC1234", -1, "*+ABC1234+*" },
|
||||
/* 40*/ { BARCODE_HIBC_39, -1, "abc1234", -1, "*+ABC1234+*" }, /* Converts to upper */
|
||||
/* 41*/ { BARCODE_HIBC_39, -1, "123456789", -1, "*+1234567890*" },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
|
@ -222,40 +230,45 @@ static void test_input(const testCtx *const p_ctx) {
|
|||
/* 25*/ { BARCODE_CODE39, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 26*/ { BARCODE_CODE39, 0, "1", -1, 0, 1, 38 },
|
||||
/* 27*/ { BARCODE_CODE39, 1, "1", -1, 0, 1, 51 }, /* Check digit */
|
||||
/* 28*/ { BARCODE_CODE39, 2, "1", -1, 0, 1, 38 }, /* option_2 > 1 gnored */
|
||||
/* 29*/ { BARCODE_EXCODE39, -1, "A", -1, 0, 1, 38 },
|
||||
/* 30*/ { BARCODE_EXCODE39, -1, "a", -1, 0, 1, 51 },
|
||||
/* 31*/ { BARCODE_EXCODE39, -1, ",", -1, 0, 1, 51 },
|
||||
/* 32*/ { BARCODE_EXCODE39, -1, "\000", 1, 0, 1, 51 },
|
||||
/* 33*/ { BARCODE_EXCODE39, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 34*/ { BARCODE_EXCODE39, -1, "é", -1, ZINT_ERROR_INVALID_DATA, -1, -1, },
|
||||
/* 35*/ { BARCODE_LOGMARS, -1, "A", -1, 0, 1, 47 },
|
||||
/* 36*/ { BARCODE_LOGMARS, -1, "a", -1, 0, 1, 47 },
|
||||
/* 37*/ { BARCODE_LOGMARS, -1, ",", -1, ZINT_ERROR_INVALID_DATA, -1, -1, },
|
||||
/* 38*/ { BARCODE_LOGMARS, -1, "\000", 1, ZINT_ERROR_INVALID_DATA, -1, -1, },
|
||||
/* 39*/ { BARCODE_LOGMARS, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1, },
|
||||
/* 40*/ { BARCODE_CODE93, -1, "A", -1, 0, 1, 46 },
|
||||
/* 41*/ { BARCODE_CODE93, -1, "a", -1, 0, 1, 55 },
|
||||
/* 42*/ { BARCODE_CODE93, -1, ",", -1, 0, 1, 55 },
|
||||
/* 43*/ { BARCODE_CODE93, -1, "\000", 1, 0, 1, 55 },
|
||||
/* 44*/ { BARCODE_CODE93, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 45*/ { BARCODE_CODE93, -1, "é", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 46*/ { BARCODE_PZN, -1, "1", -1, 0, 1, 142 },
|
||||
/* 47*/ { BARCODE_PZN, -1, "A", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 48*/ { BARCODE_PZN, -1, "1000006", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* Check digit == 10 so can't be used */
|
||||
/* 49*/ { BARCODE_PZN, -1, "00000011", -1, ZINT_ERROR_INVALID_CHECK, -1, -1 },
|
||||
/* 50*/ { BARCODE_PZN, 1, "100009", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* Check digit == 10 so can't be used */
|
||||
/* 51*/ { BARCODE_PZN, 1, "0000011", -1, ZINT_ERROR_INVALID_CHECK, -1, -1 },
|
||||
/* 52*/ { BARCODE_VIN, -1, "5GZCZ43D13S812715", -1, 0, 1, 246 },
|
||||
/* 53*/ { BARCODE_VIN, -1, "5GZCZ43D23S812715", -1, ZINT_ERROR_INVALID_CHECK, -1, -1 }, /* North American with invalid check character */
|
||||
/* 54*/ { BARCODE_VIN, -1, "WP0ZZZ99ZTS392124", -1, 0, 1, 246 }, /* Not North American so no check */
|
||||
/* 55*/ { BARCODE_VIN, -1, "WP0ZZZ99ZTS392I24", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* I not allowed */
|
||||
/* 56*/ { BARCODE_VIN, -1, "WPOZZZ99ZTS392124", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* O not allowed */
|
||||
/* 57*/ { BARCODE_VIN, -1, "WPQZZZ99ZTS392124", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* Q not allowed */
|
||||
/* 58*/ { BARCODE_HIBC_39, -1, "a", -1, 0, 1, 79 }, /* Converts to upper */
|
||||
/* 59*/ { BARCODE_HIBC_39, -1, ",", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 60*/ { BARCODE_HIBC_39, -1, "\000", 1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 61*/ { BARCODE_HIBC_39, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 28*/ { BARCODE_CODE39, 2, "1", -1, 0, 1, 51 }, /* Hidden check digit */
|
||||
/* 29*/ { BARCODE_CODE39, 3, "1", -1, 0, 1, 38 }, /* option_2 > 2 ignored */
|
||||
/* 30*/ { BARCODE_EXCODE39, -1, "A", -1, 0, 1, 38 },
|
||||
/* 31*/ { BARCODE_EXCODE39, 3, "A", -1, 0, 1, 38 }, /* option_2 > 2 ignored */
|
||||
/* 32*/ { BARCODE_EXCODE39, -1, "a", -1, 0, 1, 51 },
|
||||
/* 33*/ { BARCODE_EXCODE39, -1, ",", -1, 0, 1, 51 },
|
||||
/* 34*/ { BARCODE_EXCODE39, -1, "\000", 1, 0, 1, 51 },
|
||||
/* 35*/ { BARCODE_EXCODE39, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 36*/ { BARCODE_EXCODE39, -1, "é", -1, ZINT_ERROR_INVALID_DATA, -1, -1, },
|
||||
/* 37*/ { BARCODE_LOGMARS, -1, "A", -1, 0, 1, 47 },
|
||||
/* 38*/ { BARCODE_LOGMARS, -1, "a", -1, 0, 1, 47 },
|
||||
/* 39*/ { BARCODE_LOGMARS, -1, ",", -1, ZINT_ERROR_INVALID_DATA, -1, -1, },
|
||||
/* 40*/ { BARCODE_LOGMARS, -1, "\000", 1, ZINT_ERROR_INVALID_DATA, -1, -1, },
|
||||
/* 41*/ { BARCODE_LOGMARS, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1, },
|
||||
/* 42*/ { BARCODE_LOGMARS, 3, "A", -1, 0, 1, 47 }, /* option_2 > 2 ignored */
|
||||
/* 43*/ { BARCODE_CODE93, -1, "A", -1, 0, 1, 46 },
|
||||
/* 44*/ { BARCODE_CODE93, -1, "a", -1, 0, 1, 55 },
|
||||
/* 45*/ { BARCODE_CODE93, -1, ",", -1, 0, 1, 55 },
|
||||
/* 46*/ { BARCODE_CODE93, -1, "\000", 1, 0, 1, 55 },
|
||||
/* 47*/ { BARCODE_CODE93, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 48*/ { BARCODE_CODE93, -1, "é", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 49*/ { BARCODE_PZN, -1, "1", -1, 0, 1, 142 },
|
||||
/* 50*/ { BARCODE_PZN, -1, "A", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 51*/ { BARCODE_PZN, -1, "1000006", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* Check digit == 10 so can't be used */
|
||||
/* 52*/ { BARCODE_PZN, -1, "00000011", -1, ZINT_ERROR_INVALID_CHECK, -1, -1 },
|
||||
/* 53*/ { BARCODE_PZN, 1, "100009", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* Check digit == 10 so can't be used */
|
||||
/* 54*/ { BARCODE_PZN, 1, "0000011", -1, ZINT_ERROR_INVALID_CHECK, -1, -1 },
|
||||
/* 55*/ { BARCODE_VIN, -1, "5GZCZ43D13S812715", -1, 0, 1, 246 },
|
||||
/* 56*/ { BARCODE_VIN, -1, "5GZCZ43D23S812715", -1, ZINT_ERROR_INVALID_CHECK, -1, -1 }, /* North American with invalid check character */
|
||||
/* 57*/ { BARCODE_VIN, -1, "WP0ZZZ99ZTS392124", -1, 0, 1, 246 }, /* Not North American so no check */
|
||||
/* 58*/ { BARCODE_VIN, -1, "WP0ZZZ99ZTS392I24", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* I not allowed */
|
||||
/* 59*/ { BARCODE_VIN, -1, "WPOZZZ99ZTS392124", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* O not allowed */
|
||||
/* 60*/ { BARCODE_VIN, -1, "WPQZZZ99ZTS392124", -1, ZINT_ERROR_INVALID_DATA, -1, -1 }, /* Q not allowed */
|
||||
/* 61*/ { BARCODE_HIBC_39, -1, "a", -1, 0, 1, 79 }, /* Converts to upper */
|
||||
/* 62*/ { BARCODE_HIBC_39, -1, ",", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 63*/ { BARCODE_HIBC_39, -1, "\000", 1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 64*/ { BARCODE_HIBC_39, -1, "\300", -1, ZINT_ERROR_INVALID_DATA, -1, -1 },
|
||||
/* 65*/ { BARCODE_HIBC_39, 1, "a", -1, 0, 1, 79 }, /* option_2 ignored */
|
||||
/* 66*/ { BARCODE_HIBC_39, 2, "a", -1, 0, 1, 79 }, /* option_2 ignored */
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
|
|
|
@ -1335,7 +1335,6 @@ static void test_clear(const testCtx *const p_ctx) {
|
|||
|
||||
assert_nonzero(symbol->rows, "ZBarcode_Buffer() rows 0\n");
|
||||
assert_nonzero(symbol->width, "ZBarcode_Buffer() width 0\n");
|
||||
assert_zero(symbol->bitmap_byte_length, "ZBarcode_Buffer() bitmap_byte_length %d != 0\n", (int) symbol->bitmap_byte_length);
|
||||
assert_null(symbol->vector, "ZBarcode_Buffer() vector != NULL\n");
|
||||
|
||||
ZBarcode_Clear(symbol);
|
||||
|
@ -1347,7 +1346,6 @@ static void test_clear(const testCtx *const p_ctx) {
|
|||
|
||||
assert_zero(symbol->rows, "ZBarcode_Buffer() rows %d != 0\n", symbol->rows);
|
||||
assert_zero(symbol->width, "ZBarcode_Buffer() width %d != 0\n", symbol->width);
|
||||
assert_zero(symbol->bitmap_byte_length, "ZBarcode_Buffer() bitmap_byte_length %d != 0\n", (int) symbol->bitmap_byte_length);
|
||||
assert_null(symbol->vector, "ZBarcode_Buffer() vector != NULL\n");
|
||||
|
||||
/* Vector */
|
||||
|
@ -1371,7 +1369,6 @@ static void test_clear(const testCtx *const p_ctx) {
|
|||
assert_nonzero(symbol->width, "ZBarcode_Buffer_Vector() width 0\n");
|
||||
assert_null(symbol->bitmap, "ZBarcode_Buffer_Vector() bitmap != NULL\n");
|
||||
assert_null(symbol->alphamap, "ZBarcode_Buffer_Vector() alphamap != NULL\n");
|
||||
assert_zero(symbol->bitmap_byte_length, "ZBarcode_Buffer_Vector() bitmap_byte_length %d != 0\n", (int) symbol->bitmap_byte_length);
|
||||
|
||||
ZBarcode_Clear(symbol);
|
||||
|
||||
|
@ -1379,7 +1376,6 @@ static void test_clear(const testCtx *const p_ctx) {
|
|||
|
||||
assert_zero(symbol->rows, "ZBarcode_Buffer_Vector() rows %d != 0\n", symbol->rows);
|
||||
assert_zero(symbol->width, "ZBarcode_Buffer_Vector() width %d != 0\n", symbol->width);
|
||||
assert_zero(symbol->bitmap_byte_length, "ZBarcode_Buffer_Vector() bitmap_byte_length %d != 0\n", (int) symbol->bitmap_byte_length);
|
||||
assert_null(symbol->bitmap, "ZBarcode_Buffer_Vector() bitmap != NULL\n");
|
||||
assert_null(symbol->alphamap, "ZBarcode_Buffer_Vector() alphamap != NULL\n");
|
||||
assert_zero(symbol->bitmap_width, "ZBarcode_Buffer_Vector() bitmap_width %d != 0\n", symbol->bitmap_width);
|
||||
|
|
|
@ -130,7 +130,6 @@ extern "C" {
|
|||
int bitmap_width; /* Width of bitmap image (raster output only) */
|
||||
int bitmap_height; /* Height of bitmap image (raster output only) */
|
||||
unsigned char *alphamap; /* Array of alpha values used (raster output only) */
|
||||
unsigned int bitmap_byte_length; /* Size of BMP bitmap data (raster output only) */
|
||||
struct zint_vector *vector; /* Pointer to vector header (vector output only) */
|
||||
};
|
||||
|
||||
|
@ -290,7 +289,7 @@ extern "C" {
|
|||
/* Note: CODE16K, CODE49, CODABLOCKF, ITF14, EAN/UPC have default quiet zones
|
||||
*/
|
||||
#define BARCODE_NO_QUIET_ZONES 0x1000 /* Disable quiet zones, notably those with defaults as listed above */
|
||||
#define COMPLIANT_HEIGHT 0x2000 /* Warn if height not compliant and use standard height (if any) as default */
|
||||
#define COMPLIANT_HEIGHT 0x2000 /* Warn if height not compliant, or use standard height (if any) as default */
|
||||
#define EANUPC_GUARD_WHITESPACE 0x4000 /* Add quiet zone indicators ("<"/">") to HRT whitespace (EAN/UPC) */
|
||||
#define EMBED_VECTOR_FONT 0x8000 /* Embed font in vector output - currently only for SVG output */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue