1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-06-10 15:43:40 +00:00
template, props Dmitry Smirnov (ticket #147, props John Crisp);
  TODO: enable building with the GS1 Syntax Engine;
  this involved auditing copyrights which prompted the next item
  re "tif.c" and will prompt the next next item "pdf417.c"
tif.c: replaced LZW compression with tree-based one due to
  "tif_lzw.h"'s original BSD-TAHOE license which has the equivalent
  of the "advertising clause", new implementation (which is much
  faster anyway) props Harald Kuhr and Bob Montgomery
pdf417.c: TODO: Replace all code adapted from "pdf417.frm" as it
  was released under GPL v2.0 or later
pdf417.h: replace unnecessary "pdf417.frm" references with ISO/IEC
  standard as 1st step re above, some expanded comments
general: Codablock-F -> Codablock F (i.e. lose hyphen)
cmake: frontend/frontend_qt: go back to only setting RPATH on macOS
  as not Debian compatible and it seems it's not a good idea on
  Linux anyway; TODO: check BSD + other Unixes
CLI/GUI: make "--verbose" option official and document
tools/gen_eci_sb_h.php/gen_eci_mb_h.php: add SPDX Unicode-3.0;
  update haible.de/bruno tarball info - "GB18030.TXT" no longer in
  "jdk-1.4.2/" so mention "libiconv-1.11/" version instead (same)
general: add various SPDXs and normalize some Copyrights
reedsol.c: malloced `logt`/`alog` tables int -> short (slight
  performance improvement)
aztec.c: add copyrights, some code fiddling
BWIPP: update to latest
This commit is contained in:
gitlost
2026-03-18 15:08:32 +00:00
parent db03f0b304
commit df64a0f237
70 changed files with 1404 additions and 755 deletions
+9 -9
View File
@@ -1,4 +1,4 @@
Version 2.16.0.9 (dev) not released yet (2026-03-11) Version 2.16.0.9 (dev) not released yet (2026-03-18)
==================================================== ====================================================
**Incompatible changes** **Incompatible changes**
@@ -212,7 +212,7 @@ Changes
outside digit to be 4X/2X instead of 5X/3X away from main symbol so as not to outside digit to be 4X/2X instead of 5X/3X away from main symbol so as not to
touch add-on TODO: revisit when standard clarified touch add-on TODO: revisit when standard clarified
- manual: make explicit that AI "(00)" and "(01)" prefixes added by Zint are - manual: make explicit that AI "(00)" and "(01)" prefixes added by Zint are
HRT-only; clarify Codablock-F length maximum & add examples HRT-only; clarify Codablock F length maximum & add examples
- add DXFILMEDGE (MR #159, props Antoine Mérino) - add DXFILMEDGE (MR #159, props Antoine Mérino)
Bugs Bugs
@@ -1062,7 +1062,7 @@ by brunt@SF
Version 2.5 2016-11-13 Version 2.5 2016-11-13
====================== ======================
Support for DotCode and Han Xin code. ECI code processing. Output to BMP, GIF Support for DotCode and Han Xin code. ECI code processing. Output to BMP, GIF
and PCX. Added bold and small text options. Reintroduction of Codablock-F. and PCX. Added bold and small text options. Reintroduction of Codablock F.
Many minor fixes and improvements. Many minor fixes and improvements.
@@ -1096,7 +1096,7 @@ minor bugfixes for ISBN and Aztec Code, and added some small features like a
Version 2.3.1 2010-04-07 Version 2.3.1 2010-04-07
======================== ========================
Removed Codablock-F. Redesigned scale function so that human readable Removed Codablock F. Redesigned scale function so that human readable
text and Maxicode symbols can be scaled consistently. Corrected encoding bugs text and Maxicode symbols can be scaled consistently. Corrected encoding bugs
with Code 128/Code 16k and Data Matrix ECC200 ECC 050. Added --notext option to with Code 128/Code 16k and Data Matrix ECC200 ECC 050. Added --notext option to
CLI. CLI.
@@ -1155,7 +1155,7 @@ Version 2.1.2 2009-03-01
======================== ========================
Added SVG output option. Improved Japanese character support including Added SVG output option. Improved Japanese character support including
Unicode > Shift-JIS capability. Bugfixes for Data Matrix ECC200 (missing Unicode > Shift-JIS capability. Bugfixes for Data Matrix ECC200 (missing
characters at end of string) and Codablock-F (K1/K2 check digit and row characters at end of string) and Codablock F (K1/K2 check digit and row
indicators above row 6). indicators above row 6).
@@ -1168,9 +1168,9 @@ Version 2.1 2009-01-31
====================== ======================
Reinstated Korea Post barcodes, harmonised bind and box options, moved Reinstated Korea Post barcodes, harmonised bind and box options, moved
Unicode handling into backend and added input_mode option, added size options Unicode handling into backend and added input_mode option, added size options
to Data Matrix ECC200, added NULL character handling for Codablock-F, Code 128, to Data Matrix ECC200, added NULL character handling for Codablock F, Code 128,
Code 16k, Extended Code 39, Code 93, Telepen, Maxicode, Data Matrix ECC200 ECC Code 16k, Extended Code 39, Code 93, Telepen, Maxicode, Data Matrix ECC200 ECC
200, PDF417 and MicroPDF417. Added GS1 support for Code 16k, Codablock-F and 200, PDF417 and MicroPDF417. Added GS1 support for Code 16k, Codablock F and
Aztec Code. Added scale and direct to stdout options. Rebuilt Data Matrix ECC200 Aztec Code. Added scale and direct to stdout options. Rebuilt Data Matrix ECC200
ECC 200 encoding algorithms to support NULL encoding and GS1 data encoding. ECC 200 encoding algorithms to support NULL encoding and GS1 data encoding.
@@ -1185,13 +1185,13 @@ information.
Version 2.0 beta r2 2008-10-19 Version 2.0 beta r2 2008-10-19
============================== ==============================
Many corrections and bugfixes. (Code 11, Code 128, EAN-128, Many corrections and bugfixes. (Code 11, Code 128, EAN-128,
Aztec Code, Codablock-F, Code 16k, POSTNET, PLANET, NVE-18, PZN, Data Matrix Aztec Code, Codablock F, Code 16k, POSTNET, PLANET, NVE-18, PZN, Data Matrix
ECC200, Maxicode and QR Code) ECC200, Maxicode and QR Code)
Version 2.0 beta 2008-09-29 Version 2.0 beta 2008-09-29
=========================== ===========================
Added support for Aztec Code, Codablock-F, Code 32, EAN-14 and DAFT Added support for Aztec Code, Codablock F, Code 32, EAN-14 and DAFT
Code. Rearranged symbology numbers to match Tbarcode v8. Corrected a never Code. Rearranged symbology numbers to match Tbarcode v8. Corrected a never
ending loop bug in EAN-128. ending loop bug in EAN-128.
+2 -2
View File
@@ -16,7 +16,7 @@ BC412 (SEMI T1-95) Han Xin (Chinese Sensible) Code
Brazilian Postal Code (CEPNet) ISBN Brazilian Postal Code (CEPNet) ISBN
Channel Code ITF-14 Channel Code ITF-14
Codabar Japanese Postal Barcode Codabar Japanese Postal Barcode
Codablock-F (and HIBC) Korean Postal Barcode Codablock F (and HIBC) Korean Postal Barcode
Code 11 LOGMARS Code 11 LOGMARS
Code 128 (and GS1-128 and HIBC) MaxiCode Code 128 (and GS1-128 and HIBC) MaxiCode
Code 16K MicroPDF417 (and HIBC) Code 16K MicroPDF417 (and HIBC)
@@ -63,7 +63,7 @@ Please see "ChangeLog" in the project root directory.
LICENSE LICENSE
------- -------
Zint, libzint and Zint Barcode Studio are Copyright © 2025 Robin Stuart. All Zint, libzint and Zint Barcode Studio are Copyright © 2026 Robin Stuart. All
historical versions are distributed under the GNU General Public License historical versions are distributed under the GNU General Public License
version 3 or later. Versions 2.5 and later are released under a dual license: version 3 or later. Versions 2.5 and later are released under a dual license:
the encoding library is released under the BSD (3 clause) license whereas the the encoding library is released under the BSD (3 clause) license whereas the
+58
View File
@@ -0,0 +1,58 @@
% README.deb 2026-03-18
% Tested on Ubuntu 24.04 LTS
% vim: set ts=4 sw=4 et :
The "debian" directory is included to enable creating a local Debian dpkg ".deb" file.
(The official Debian package is at https://salsa.debian.org/debian/zint)
Prerequisites are being on a Debian-based Linux system and the usual stuff for building zint (see "README.linux").
To create a local package, first clone the latest source:
git clone https://git.code.sf.net/p/zint/code zint
Then create an archive:
cd zint
git archive -o /tmp/zint.tar.gz HEAD
cd ..
Create a new directory (it doesn't matter where):
mkdir zint-deb
Then untar the source archive into a sub-directory of the new directory:
cd zint-deb
mkdir zint-2.16.0.9-src
cd zint-2.16.0.9-src
tar xf /tmp/zint.tar.gz
cd ..
tar cvzf zint_2.16.0.9.orig.tar.gz zint-2.16.0.9-src
Note the very specific naming of the tarball and the use of an underscore: "zint_<ver>.orig.tar.gz".
Then run dpkg-buildpackage in the source sub-directory:
cd zint-2.16.0.9-src
dpkg-buildpackage -us -uc
cd ..
If this works, there should be four ".deb" files (amongst other stuff) in the zint-deb directory, namely:
libzint2.16_2.16.0.9-1_<arch>.deb
libzint-dev_2.16.0.9-1_<arch>.deb
zint_2.16.0.9-1_<arch>.deb
zint-qt_2.16.0.9-1_<arch>.deb
where "<arch>" is e.g. "amd64" on an Intel system.
The ".deb" files can then be installed on "<arch>" systems, starting with the "libzint" ones first, e.g.
sudo dpkg -i libzint2.16_2.16.0.9-1_amd64.deb
You may be prompted by dpkg to add other packages first.
Note that the GS1 Syntax Engine is not yet supported by the included "debian" directory (nor by the official
Debian package for that matter), which is an issue.
+2 -1
View File
@@ -1,11 +1,12 @@
% README.linux 2026-01-01 % README.linux 2026-01-01
% Tested on Ubuntu 20.04.4 LTS, Ubuntu 22.04 LTS, Ubuntu 24.04 LTS and % Tested on Ubuntu 20.04.4 LTS, Ubuntu 22.04 LTS, Ubuntu 24.04 LTS and
% Fedora Linux 43 (Workstation Edition) % Fedora Linux 43 (Workstation Edition)
% vim: set ts=4 sw=4 et :
1. Prerequisites for building zint 1. Prerequisites for building zint
================================== ==================================
Prerequisites are git, cmake, make, gcc and gcc-c++, e.g. Ubuntu/Debian Prerequisites are git, cmake, make, cc and c++, e.g. Ubuntu/Debian
sudo apt install git cmake build-essential sudo apt install git cmake build-essential
+5 -5
View File
@@ -1,10 +1,10 @@
Contents 2026-03-18
--------
2025-01-21
Here is a guide to which bit of source code does what. Here is a guide to which bit of source code does what.
library.c:
API entry points
2of5.c: 2of5.c:
Code 2 of 5 Standard (Matrix) Code 2 of 5 Standard (Matrix)
Code 2 of 5 Industrial Code 2 of 5 Industrial
@@ -40,7 +40,7 @@ codabar.c:
Codabar Codabar
codablock.c: codablock.c:
Codablock-F Codablock F
code11.c: code11.c:
Code 11 Code 11
+11 -21
View File
@@ -96,9 +96,9 @@ static int az_reduce(char *modes, unsigned char *source, const int length) {
modes[j] = modes[i]; modes[j] = modes[i];
if ((modes[i] == AZ_P || (modes[i] & AZ_PS)) && AZ_DOUBLE_PUNCT_NO_LEN_CHECK(source, i)) { if ((modes[i] == AZ_P || (modes[i] & AZ_PS)) && AZ_DOUBLE_PUNCT_NO_LEN_CHECK(source, i)) {
if (source[i] == '\r') { if (source[i] == '\r') {
source[j] = 'a'; /* "\r\n" */ source[j] = 'a'; /* (CR LF) */
} else { } else {
source[j] = 'b' + 7 - ((source[i] & 0x0F) >> 1); /* ". " -> 'b', ", " -> 'c', ": " -> 'd' */ source[j] = 'b' + 7 - ((source[i] & 0x0F) >> 1); /* (. SP) -> 'b', (, SP) -> 'c', (: SP) -> 'd' */
} }
i += 2; i += 2;
} else { } else {
@@ -124,7 +124,7 @@ static char az_mode_char(const char mode) {
if (mode & AZ_US) { if (mode & AZ_US) {
assert(AZ_MASK(mode) == AZ_L || AZ_MASK(mode) == AZ_D); assert(AZ_MASK(mode) == AZ_L || AZ_MASK(mode) == AZ_D);
return AZ_MASK(mode) == AZ_L ? 'r' : 't'; return AZ_MASK(mode) == AZ_L ? 'K' : 'C';
} }
assert(AZ_MASK(mode) < ARRAY_SIZE(mode_chars)); assert(AZ_MASK(mode) < ARRAY_SIZE(mode_chars));
@@ -164,7 +164,7 @@ static int az_text_modes(char modes[], unsigned char source[], int length, const
} }
} }
/* Deal first with letter combinations which can be combined to one codeword /* Deal first with letter combinations which can be combined to one codeword.
Combinations are (CR LF) (. SP) (, SP) (: SP) in Punct mode */ Combinations are (CR LF) (. SP) (, SP) (: SP) in Punct mode */
current_mode = initial_mode; current_mode = initial_mode;
for (i = 0; i + 1 < length; i++) { for (i = 0; i + 1 < length; i++) {
@@ -182,28 +182,16 @@ static int az_text_modes(char modes[], unsigned char source[], int length, const
count = az_count_doubles(source, length, i); count = az_count_doubles(source, length, i);
next_mode = az_get_next_mode(modes, length, i); next_mode = az_get_next_mode(modes, length, i);
if (current_mode == AZ_U) { if (next_mode == AZ_D) {
if (next_mode == AZ_D && count <= 5) { if ((current_mode == AZ_U && count <= 5) || (current_mode == AZ_L && count <= 4)
|| (current_mode == AZ_M && count == 1) || (current_mode == AZ_D && count <= 7)) {
memset(modes + i, AZ_D, 2 * count); memset(modes + i, AZ_D, 2 * count);
} }
} else if (current_mode == AZ_L) { } else if (current_mode == AZ_D && count <= 4) {
if (next_mode == AZ_D && count <= 4) {
memset(modes + i, AZ_D, 2 * count); memset(modes + i, AZ_D, 2 * count);
} }
} else if (current_mode == AZ_M) {
if (next_mode == AZ_D && count == 1) {
modes[i] = AZ_D;
modes[i + 1] = AZ_D;
}
} else if (current_mode == AZ_D) {
if ((next_mode != AZ_D && count <= 4) || (next_mode == AZ_D && count <= 7)) {
memset(modes + i, AZ_D, 2 * count);
}
}
/* Default is Punct mode */ /* Default is Punct mode */
if (modes[i] == AZ_X) { if (modes[i] == AZ_X) {
modes[i] = AZ_P; modes[i] = AZ_P;
@@ -976,6 +964,8 @@ static int az_UpdateStateListForChar(struct az_state_list *list, const unsigned
/* Default, optimized encodation algorithm by Frank Yellin and Rustam Abdullaev, adapted from ZXing via zxing-cpp's /* Default, optimized encodation algorithm by Frank Yellin and Rustam Abdullaev, adapted from ZXing via zxing-cpp's
`HighLevelEncoder::Encode()` & slightly improved */ `HighLevelEncoder::Encode()` & slightly improved */
/* Copyright 2013 ZXing authors */ /* ZXing */
/* Copyright 2016 Huy Cuong Nguyen */ /* zxing-cpp */
/* SPDX-License-Identifier: Apache-2.0 */ /* SPDX-License-Identifier: Apache-2.0 */
/* Note that a bitstream that is encoded to be shortest based on mode choices may not be so after bit-stuffing */ /* Note that a bitstream that is encoded to be shortest based on mode choices may not be so after bit-stuffing */
static int az_binary_string(unsigned char source[], const int length, int bp, static int az_binary_string(unsigned char source[], const int length, int bp,
@@ -1002,7 +992,7 @@ static int az_binary_string(unsigned char source[], const int length, int bp,
fprintf(stderr, "index %d\n", (int) i); fprintf(stderr, "index %d\n", (int) i);
#endif #endif
if (AZ_DOUBLE_PUNCT(source, length, i)) { if (AZ_DOUBLE_PUNCT(source, length, i)) {
/* "\r\n" -> 2, ". " -> 3, ", " -> 4, ": " -> 5 */ /* (CR LF) -> 2, (. SP) -> 3, (, SP) -> 4, (: SP) -> 5 */
const int pairCode = source[i] == '\r' ? 2 : 3 + 7 - ((source[i] & 0x0F) >> 1); const int pairCode = source[i] == '\r' ? 2 : 3 + 7 - ((source[i] & 0x0F) >> 1);
if (!az_UpdateStateListForPair(list, i, pairCode)) { if (!az_UpdateStateListForPair(list, i, pairCode)) {
az_state_list_free(list); az_state_list_free(list);
+1
View File
@@ -30,6 +30,7 @@
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
#ifndef Z_BIG5_H #ifndef Z_BIG5_H
#define Z_BIG5_H #define Z_BIG5_H
+3 -3
View File
@@ -1,4 +1,4 @@
/* codablock.c - Handles Codablock-F */ /* codablock.c - Handles Codablock F */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2016-2026 Harald Oehlmann Copyright (C) 2016-2026 Harald Oehlmann
@@ -50,7 +50,7 @@
#define ZTNum (CodeA | CodeB | CodeC) #define ZTNum (CodeA | CodeB | CodeC)
#define ZTFNC1 (CodeA | CodeB | CodeC | CodeFNC1) #define ZTFNC1 (CodeA | CodeB | CodeC | CodeFNC1)
/* ASCII-Extension for Codablock-F */ /* ASCII-Extension for Codablock F */
#define aFNC1 ((uchar) 128) #define aFNC1 ((uchar) 128)
#define aFNC2 ((uchar) 129) #define aFNC2 ((uchar) 129)
#define aFNC3 ((uchar) 130) #define aFNC3 ((uchar) 130)
@@ -513,7 +513,7 @@ static void ASCIIZ128(uchar **ppOutPos, const int CharacterSet, const uchar c1,
A2C128_C(ppOutPos, c1, c2); A2C128_C(ppOutPos, c1, c2);
} }
/* XLate Tables D.2, D.3 and F.1 of Codablock-F Specification and call output /* XLate Tables D.2, D.3 and F.1 of Codablock F Specification and call output
*/ */
static void SumASCII(uchar **ppOutPos, const int Sum, const int CharacterSet) { static void SumASCII(uchar **ppOutPos, const int Sum, const int CharacterSet) {
switch (CharacterSet) { switch (CharacterSet) {
+1
View File
@@ -697,6 +697,7 @@ INTERNAL unsigned int z_decode_utf8(unsigned int *state, unsigned int *codep, co
See https://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details. See https://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
*/ */
/* SPDX-License-Identifier: Apache-2.0 */
static const unsigned char utf8d[] = { static const unsigned char utf8d[] = {
/* The first part of the table maps bytes to character classes that /* The first part of the table maps bytes to character classes that
+2 -1
View File
@@ -1,7 +1,7 @@
/* composite.c - Handles GS1 Composite Symbols */ /* composite.c - Handles GS1 Composite Symbols */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2008-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2008-2026 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
@@ -809,6 +809,7 @@ static int cc_binary_string(struct zint_symbol *symbol, const unsigned char sour
/* So still need FNC1 character but can't do single FNC1 in numeric mode, so insert alphanumeric latch /* So still need FNC1 character but can't do single FNC1 in numeric mode, so insert alphanumeric latch
"0000" and alphanumeric FNC1 "01111" (this implementation detail taken from BWIPP "0000" and alphanumeric FNC1 "01111" (this implementation detail taken from BWIPP
https://github.com/bwipp/postscriptbarcode Copyright (c) 2004-2019 Terry Burton) */ https://github.com/bwipp/postscriptbarcode Copyright (c) 2004-2019 Terry Burton) */
/* SPDX-License-Identifier: MIT */
bp = z_bin_append_posn(15, 9, binary_string, bp); /* "000001111" */ bp = z_bin_append_posn(15, 9, binary_string, bp); /* "000001111" */
/* Note an alphanumeric FNC1 is also a numeric latch, so now in numeric mode */ /* Note an alphanumeric FNC1 is also a numeric latch, so now in numeric mode */
} }
+2 -2
View File
@@ -8,8 +8,8 @@
Adrian Kennard, Andrews & Arnold Ltd Adrian Kennard, Andrews & Arnold Ltd
with help from Cliff Hones on the RS coding with help from Cliff Hones on the RS coding
(c) 2004 Adrian Kennard, Andrews & Arnold Ltd Copyright (c) 2004 Adrian Kennard, Andrews & Arnold Ltd
(c) 2006 Stefan Schmidt <stefan@datenfreihafen.org> Copyright (c) 2006 Stefan Schmidt <stefan@datenfreihafen.org>
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
+2 -1
View File
@@ -4,7 +4,7 @@
"https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP125*.TXT" */ "https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP125*.TXT" */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2021-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2021-2026 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
@@ -32,6 +32,7 @@
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
#ifndef Z_ECI_SB_H #ifndef Z_ECI_SB_H
#define Z_ECI_SB_H #define Z_ECI_SB_H
+2 -1
View File
@@ -1,5 +1,5 @@
/* gb18030.h - tables for Unicode to GB 18030-2005, generated by "backend/tools/gen_eci_mb_h.php" /* gb18030.h - tables for Unicode to GB 18030-2005, generated by "backend/tools/gen_eci_mb_h.php"
from "jdk-1.4.2/GB18030.TXT" from "libiconv-1.11/GB18030.TXT"
(see https://haible.de/bruno/charsets/conversion-tables/GB18030.tar.bz2) */ (see https://haible.de/bruno/charsets/conversion-tables/GB18030.tar.bz2) */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
@@ -31,6 +31,7 @@
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
#ifndef Z_GB18030_H #ifndef Z_GB18030_H
#define Z_GB18030_H #define Z_GB18030_H
+1
View File
@@ -31,6 +31,7 @@
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
#ifndef Z_GB2312_H #ifndef Z_GB2312_H
#define Z_GB2312_H #define Z_GB2312_H
+1
View File
@@ -30,6 +30,7 @@
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
#ifndef Z_GBK_H #ifndef Z_GBK_H
#define Z_GBK_H #define Z_GBK_H
+2 -1
View File
@@ -1,7 +1,7 @@
/* gridmtx.c - Grid Matrix */ /* gridmtx.c - Grid Matrix */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2009-2026 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
@@ -127,6 +127,7 @@ static int gm_in_numeral(const unsigned int ddata[], const int length, const int
/* Calculate optimized encoding modes. Adapted from Project Nayuki */ /* Calculate optimized encoding modes. Adapted from Project Nayuki */
/* Copyright (c) Project Nayuki. (MIT License) See qr.c for detailed notice */ /* Copyright (c) Project Nayuki. (MIT License) See qr.c for detailed notice */
/* SPDX-License-Identifier: MIT */
static void gm_define_modes(char *modes, const unsigned int ddata[], const int length, const int debug_print) { static void gm_define_modes(char *modes, const unsigned int ddata[], const int length, const int debug_print) {
/* Must be in same order as GM_H etc */ /* Must be in same order as GM_H etc */
static const char mode_types[] = { GM_CHINESE, GM_NUMBER, GM_LOWER, GM_UPPER, GM_MIXED, GM_BYTE, '\0' }; static const char mode_types[] = { GM_CHINESE, GM_NUMBER, GM_LOWER, GM_UPPER, GM_MIXED, GM_BYTE, '\0' };
+1 -1
View File
@@ -1758,7 +1758,7 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
} else if (gs1raw_mode && !is_digital_link) { } else if (gs1raw_mode && !is_digital_link) {
if (symbol->symbology == BARCODE_GS1_128 || symbol->symbology == BARCODE_DBAR_EXP if (symbol->symbology == BARCODE_GS1_128 || symbol->symbology == BARCODE_DBAR_EXP
|| symbol->symbology == BARCODE_DBAR_EXPSTK || z_is_fixed_ratio(symbol->symbology) || symbol->symbology == BARCODE_DBAR_EXPSTK || z_is_fixed_ratio(symbol->symbology)
|| symbol->symbology == BARCODE_CODABLOCKF) { /* Codablock-F will be GS1-enabled in the future */ || symbol->symbology == BARCODE_CODABLOCKF) { /* Codablock F will be GS1-enabled in the future */
/* Prefix caret */ /* Prefix caret */
local_source_buf[0] = '^'; local_source_buf[0] = '^';
if (source[0] == '\x1D') { /* Allow initial GS */ if (source[0] == '\x1D') { /* Allow initial GS */
+2 -1
View File
@@ -1,7 +1,7 @@
/* hanxin.c - Han Xin Code */ /* hanxin.c - Han Xin Code */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2009-2026 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
@@ -353,6 +353,7 @@ static int hx_in_fourbyte(const unsigned int ddata[], const int length, const in
/* Calculate optimized encoding modes. Adapted from Project Nayuki */ /* Calculate optimized encoding modes. Adapted from Project Nayuki */
/* Copyright (c) Project Nayuki. (MIT License) See qr.c for detailed notice */ /* Copyright (c) Project Nayuki. (MIT License) See qr.c for detailed notice */
/* SPDX-License-Identifier: MIT */
static void hx_define_modes(char *modes, const unsigned int ddata[], const int length, const int debug_print) { static void hx_define_modes(char *modes, const unsigned int ddata[], const int length, const int debug_print) {
/* Must be in same order as HX_N etc */ /* Must be in same order as HX_N etc */
static const char mode_types[] = { 'n', 't', 'b', '1', '2', 'd', 'f', '\0' }; static const char mode_types[] = { 'n', 't', 'b', '1', '2', 'd', 'f', '\0' };
+1
View File
@@ -30,6 +30,7 @@
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
#ifndef Z_KSX1001_H #ifndef Z_KSX1001_H
#define Z_KSX1001_H #define Z_KSX1001_H
+1 -1
View File
@@ -457,7 +457,7 @@ static int hibc(struct zint_symbol *symbol, struct zint_seg segs[], const int se
if (symbol->debug & ZINT_DEBUG_PRINT) printf("HIBC processed source: %s\n", to_process); if (symbol->debug & ZINT_DEBUG_PRINT) printf("HIBC processed source: %s\n", to_process);
/* Code 128, Code 39 & Codablock-F set `content_segs` themselves, but the others don't, so do it now */ /* Code 128, Code 39 & Codablock F set `content_segs` themselves, but the others don't, so do it now */
assert(!symbol->content_segs); /* HIBC symbologies don't satisfy `supports_non_iso8859_1()` */ assert(!symbol->content_segs); /* HIBC symbologies don't satisfy `supports_non_iso8859_1()` */
if (content_segs && symbol->symbology != BARCODE_HIBC_128 && symbol->symbology != BARCODE_HIBC_39 if (content_segs && symbol->symbology != BARCODE_HIBC_128 && symbol->symbology != BARCODE_HIBC_39
&& symbol->symbology != BARCODE_HIBC_BLOCKF) { && symbol->symbology != BARCODE_HIBC_BLOCKF) {
+2 -1
View File
@@ -1,7 +1,7 @@
/* pcx.c - Handles output to ZSoft PCX file */ /* pcx.c - Handles output to ZSoft PCX file */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2009-2026 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
@@ -126,6 +126,7 @@ INTERNAL int zint_pcx_pixel_plot(struct zint_symbol *symbol, const unsigned char
/* Based on ImageMagick/coders/pcx.c PCXWritePixels() /* Based on ImageMagick/coders/pcx.c PCXWritePixels()
* Copyright 1999-2020 ImageMagick Studio LLC */ * Copyright 1999-2020 ImageMagick Studio LLC */
/* SPDX-License-Identifier: ImageMagick */
previous = rle_row[0]; previous = rle_row[0];
run_count = 1; run_count = 1;
for (column = 1; column < bytes_per_line; column++) { /* Note going up to bytes_per_line */ for (column = 1; column < bytes_per_line; column++) { /* Note going up to bytes_per_line */
+13 -12
View File
@@ -32,9 +32,16 @@
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/*
*********************************************************************************************
* TODO: Replace all code adapted from "pdf417.frm" as it was released under GPL v2.0 or later
*********************************************************************************************
*/
/* This code is adapted from "Code barre PDF 417 / PDF 417 barcode" v2.5.0 /* This code is adapted from "Code barre PDF 417 / PDF 417 barcode" v2.5.0
which is Copyright (C) 2004 (Grandzebu). which is Copyright (C) 2004 (Grandzebu).
The original code (file pdf417.frm) can be downloaded from https://grandzebu.net/informatique/codbar/pdf417.zip */ The original code (file pdf417.frm) can be downloaded from https://grandzebu.net/informatique/codbar/pdf417.zip */
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* NOTE: symbol->option_1 is used to specify the security level (i.e. control the /* NOTE: symbol->option_1 is used to specify the security level (i.e. control the
number of check codewords) number of check codewords)
@@ -1432,13 +1439,11 @@ static int pdf_enc(struct zint_symbol *symbol, struct zint_seg segs[], const int
bp = z_bin_append_posn(0x1FEA8, 17, pattern, bp); /* Row start */ bp = z_bin_append_posn(0x1FEA8, 17, pattern, bp); /* Row start */
for (j = 0; j <= cols; j++) { for (j = 0; j <= cols; j++) {
bp = z_bin_append_posn(zint_pdf_bitpattern[offset + dummy[j]], 16, pattern, bp); bp = z_bin_append_posn(((int) zint_pdf_bitpattern[offset + dummy[j]]) << 1, 17, pattern, bp);
pattern[bp++] = '0';
} }
if (symbol->symbology != BARCODE_PDF417COMP) { if (symbol->symbology != BARCODE_PDF417COMP) {
bp = z_bin_append_posn(zint_pdf_bitpattern[offset + dummy[j]], 16, pattern, bp); bp = z_bin_append_posn(((int) zint_pdf_bitpattern[offset + dummy[j]]) << 1, 17, pattern, bp);
pattern[bp++] = '0';
bp = z_bin_append_posn(0x3FA29, 18, pattern, bp); /* Row Stop */ bp = z_bin_append_posn(0x3FA29, 18, pattern, bp); /* Row Stop */
} else { } else {
pattern[bp++] = '1'; /* Compact PDF417 Stop pattern */ pattern[bp++] = '1'; /* Compact PDF417 Stop pattern */
@@ -1761,23 +1766,19 @@ INTERNAL int zint_micropdf417(struct zint_symbol *symbol, struct zint_seg segs[]
/* Copy the data into codebarre */ /* Copy the data into codebarre */
bp = z_bin_append_posn(zint_pdf_rap_side[LeftRAP - 1], 10, pattern, bp); bp = z_bin_append_posn(zint_pdf_rap_side[LeftRAP - 1], 10, pattern, bp);
bp = z_bin_append_posn(zint_pdf_bitpattern[offset + chainemc[k]], 16, pattern, bp); bp = z_bin_append_posn(((int) zint_pdf_bitpattern[offset + chainemc[k]]) << 1, 17, pattern, bp);
pattern[bp++] = '0';
if (symbol->option_2 >= 2) { if (symbol->option_2 >= 2) {
if (symbol->option_2 == 3) { if (symbol->option_2 == 3) {
bp = z_bin_append_posn(zint_pdf_rap_centre[CentreRAP - 1], 10, pattern, bp); bp = z_bin_append_posn(zint_pdf_rap_centre[CentreRAP - 1], 10, pattern, bp);
} }
bp = z_bin_append_posn(zint_pdf_bitpattern[offset + chainemc[k + 1]], 16, pattern, bp); bp = z_bin_append_posn(((int) zint_pdf_bitpattern[offset + chainemc[k + 1]]) << 1, 17, pattern, bp);
pattern[bp++] = '0';
if (symbol->option_2 >= 3) { if (symbol->option_2 >= 3) {
if (symbol->option_2 == 4) { if (symbol->option_2 == 4) {
bp = z_bin_append_posn(zint_pdf_rap_centre[CentreRAP - 1], 10, pattern, bp); bp = z_bin_append_posn(zint_pdf_rap_centre[CentreRAP - 1], 10, pattern, bp);
} }
bp = z_bin_append_posn(zint_pdf_bitpattern[offset + chainemc[k + 2]], 16, pattern, bp); bp = z_bin_append_posn(((int) zint_pdf_bitpattern[offset + chainemc[k + 2]]) << 1, 17, pattern, bp);
pattern[bp++] = '0';
if (symbol->option_2 == 4) { if (symbol->option_2 == 4) {
bp = z_bin_append_posn(zint_pdf_bitpattern[offset + chainemc[k + 3]], 16, pattern, bp); bp = z_bin_append_posn(((int) zint_pdf_bitpattern[offset + chainemc[k + 3]]) << 1, 17, pattern, bp);
pattern[bp++] = '0';
} }
} }
} }
+20 -17
View File
@@ -1,7 +1,7 @@
/* pdf417_tabs.h - PDF417 tables and coefficients */ /* pdf417_tabs.h - PDF417 tables and coefficients */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2008-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2008-2026 Robin Stuart <rstuart114@gmail.com>
Portions Copyright (C) 2004 Grandzebu Portions Copyright (C) 2004 Grandzebu
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -31,9 +31,6 @@
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* this file contains the character table, the pre-calculated coefficients and the
codeword patterns taken from lines 416 to 454 of pdf417.frm */
/* See "pdf417.h" for declarations */ /* See "pdf417.h" for declarations */
#ifndef Z_PDF417_TABS_H #ifndef Z_PDF417_TABS_H
@@ -43,31 +40,32 @@
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
/* PDF417 error correction coefficients from Grand Zebu */ /* PDF417 error correction coefficients from ISO/IEC 15438:2015 Annex F, Tables F.1 to F.9
k is no. of EC codewords */
INTERNAL_DATA const unsigned short zint_pdf_coefrs[1022] = { INTERNAL_DATA const unsigned short zint_pdf_coefrs[1022] = {
/* k = 2 */ /* Table F.1, k = 2 */
27, 917, 27, 917,
/* k = 4 */ /* Table F.2, k = 4 */
522, 568, 723, 809, 522, 568, 723, 809,
/* k = 8 */ /* Table F.3, k = 8 */
237, 308, 436, 284, 646, 653, 428, 379, 237, 308, 436, 284, 646, 653, 428, 379,
/* k = 16 */ /* Table F.4, k = 16 */
274, 562, 232, 755, 599, 524, 801, 132, 295, 116, 442, 428, 295, 42, 176, 65, 274, 562, 232, 755, 599, 524, 801, 132, 295, 116, 442, 428, 295, 42, 176, 65,
/* k = 32 */ /* Table F.5, k = 32 */
361, 575, 922, 525, 176, 586, 640, 321, 536, 742, 677, 742, 687, 284, 193, 517, 361, 575, 922, 525, 176, 586, 640, 321, 536, 742, 677, 742, 687, 284, 193, 517,
273, 494, 263, 147, 593, 800, 571, 320, 803, 133, 231, 390, 685, 330, 63, 410, 273, 494, 263, 147, 593, 800, 571, 320, 803, 133, 231, 390, 685, 330, 63, 410,
/* k = 64 */ /* Table F.6, k = 64 */
539, 422, 6, 93, 862, 771, 453, 106, 610, 287, 107, 505, 733, 877, 381, 612, 539, 422, 6, 93, 862, 771, 453, 106, 610, 287, 107, 505, 733, 877, 381, 612,
723, 476, 462, 172, 430, 609, 858, 822, 543, 376, 511, 400, 672, 762, 283, 184, 723, 476, 462, 172, 430, 609, 858, 822, 543, 376, 511, 400, 672, 762, 283, 184,
440, 35, 519, 31, 460, 594, 225, 535, 517, 352, 605, 158, 651, 201, 488, 502, 440, 35, 519, 31, 460, 594, 225, 535, 517, 352, 605, 158, 651, 201, 488, 502,
648, 733, 717, 83, 404, 97, 280, 771, 840, 629, 4, 381, 843, 623, 264, 543, 648, 733, 717, 83, 404, 97, 280, 771, 840, 629, 4, 381, 843, 623, 264, 543,
/* k = 128 */ /* Table F.7, k = 128 */
521, 310, 864, 547, 858, 580, 296, 379, 53, 779, 897, 444, 400, 925, 749, 415, 521, 310, 864, 547, 858, 580, 296, 379, 53, 779, 897, 444, 400, 925, 749, 415,
822, 93, 217, 208, 928, 244, 583, 620, 246, 148, 447, 631, 292, 908, 490, 704, 822, 93, 217, 208, 928, 244, 583, 620, 246, 148, 447, 631, 292, 908, 490, 704,
516, 258, 457, 907, 594, 723, 674, 292, 272, 96, 684, 432, 686, 606, 860, 569, 516, 258, 457, 907, 594, 723, 674, 292, 272, 96, 684, 432, 686, 606, 860, 569,
@@ -77,7 +75,7 @@ INTERNAL_DATA const unsigned short zint_pdf_coefrs[1022] = {
157, 374, 242, 726, 600, 269, 375, 898, 845, 454, 354, 130, 814, 587, 804, 34, 157, 374, 242, 726, 600, 269, 375, 898, 845, 454, 354, 130, 814, 587, 804, 34,
211, 330, 539, 297, 827, 865, 37, 517, 834, 315, 550, 86, 801, 4, 108, 539, 211, 330, 539, 297, 827, 865, 37, 517, 834, 315, 550, 86, 801, 4, 108, 539,
/* k = 256 */ /* Table F.8, k = 256 */
524, 894, 75, 766, 882, 857, 74, 204, 82, 586, 708, 250, 905, 786, 138, 720, 524, 894, 75, 766, 882, 857, 74, 204, 82, 586, 708, 250, 905, 786, 138, 720,
858, 194, 311, 913, 275, 190, 375, 850, 438, 733, 194, 280, 201, 280, 828, 757, 858, 194, 311, 913, 275, 190, 375, 850, 438, 733, 194, 280, 201, 280, 828, 757,
710, 814, 919, 89, 68, 569, 11, 204, 796, 605, 540, 913, 801, 700, 799, 137, 710, 814, 919, 89, 68, 569, 11, 204, 796, 605, 540, 913, 801, 700, 799, 137,
@@ -95,7 +93,7 @@ INTERNAL_DATA const unsigned short zint_pdf_coefrs[1022] = {
609, 829, 189, 20, 167, 29, 872, 449, 83, 402, 41, 656, 505, 579, 481, 173, 609, 829, 189, 20, 167, 29, 872, 449, 83, 402, 41, 656, 505, 579, 481, 173,
404, 251, 688, 95, 497, 555, 642, 543, 307, 159, 924, 558, 648, 55, 497, 10, 404, 251, 688, 95, 497, 555, 642, 543, 307, 159, 924, 558, 648, 55, 497, 10,
/* k = 512 */ /* Table F.9, k = 512 */
352, 77, 373, 504, 35, 599, 428, 207, 409, 574, 118, 498, 285, 380, 350, 492, 352, 77, 373, 504, 35, 599, 428, 207, 409, 574, 118, 498, 285, 380, 350, 492,
197, 265, 920, 155, 914, 299, 229, 643, 294, 871, 306, 88, 87, 193, 352, 781, 197, 265, 920, 155, 914, 299, 229, 643, 294, 871, 306, 88, 87, 193, 352, 781,
846, 75, 327, 520, 435, 543, 203, 666, 249, 346, 781, 621, 640, 268, 794, 534, 846, 75, 327, 520, 435, 543, 203, 666, 249, 346, 781, 621, 640, 268, 794, 534,
@@ -130,7 +128,11 @@ INTERNAL_DATA const unsigned short zint_pdf_coefrs[1022] = {
63, 310, 863, 251, 366, 304, 282, 738, 675, 410, 389, 244, 31, 121, 303, 263 63, 310, 863, 251, 366, 304, 282, 738, 675, 410, 389, 244, 31, 121, 303, 263
}; };
INTERNAL_DATA const unsigned short zint_pdf_bitpattern[2787] = { /* Encoding/decoding table of PDF417 symbol character bar-space sequences from ISO/IEC 15438:2015 Annex A
e.g. 1st entry B SBSBSB S
3 111113 6
11101010111000000 = 1110 1010 1110 0000 with last space implied = 0xEAE0 */
INTERNAL_DATA const unsigned short zint_pdf_bitpattern[2787] = { /* 2787 = 929 * 3 */
0xEAE0, 0xF578, 0xFABE, 0xEA70, 0xF53C, 0xFA9F, 0xD460, 0xEA38, 0xD430, 0xA820, 0xEAE0, 0xF578, 0xFABE, 0xEA70, 0xF53C, 0xFA9F, 0xD460, 0xEA38, 0xD430, 0xA820,
0xD418, 0xA810, 0xD6E0, 0xEB78, 0xF5BE, 0xD670, 0xEB3C, 0xF59F, 0xAC60, 0xD638, 0xD418, 0xA810, 0xD6E0, 0xEB78, 0xF5BE, 0xD670, 0xEB3C, 0xF59F, 0xAC60, 0xD638,
0xAC30, 0xAEE0, 0xD778, 0xEBBE, 0xAE70, 0xD73C, 0xEB9F, 0xAE38, 0xD71E, 0xAF78, 0xAC30, 0xAEE0, 0xD778, 0xEBBE, 0xAE70, 0xD73C, 0xEB9F, 0xAE38, 0xD71E, 0xAF78,
@@ -412,7 +414,8 @@ INTERNAL_DATA const unsigned short zint_pdf_bitpattern[2787] = {
0xC3EA, 0xC3E9, 0x83CA, 0x87DA, 0x83C9, 0x87D9, 0xE3F5 0xC3EA, 0xC3E9, 0x83CA, 0x87DA, 0x83C9, 0x87D9, 0xE3F5
}; };
/* MicroPDF417 coefficients from ISO/IEC 24728:2006 Annex F */ /* MicroPDF417 coefficients from ISO/IEC 24728:2006 Annex F
Note from Table 1 minimum no. of EC codewords (k) is 7, so don't need the entries for 3 to 6 */
INTERNAL_DATA const unsigned short zint_pdf_Microcoeffs[344] = { INTERNAL_DATA const unsigned short zint_pdf_Microcoeffs[344] = {
/* k = 7 */ /* k = 7 */
76, 925, 537, 597, 784, 691, 437, 76, 925, 537, 597, 784, 691, 437,
@@ -486,7 +489,7 @@ INTERNAL_DATA const unsigned short zint_pdf_MicroVariants[136] = { /*34*4*/
}; };
/* rows, columns, error codewords, k-offset */ /* rows, columns, error codewords, k-offset */
/* following is Left RAP, Centre RAP, Right RAP and Start Cluster from ISO/IEC 24728:2006 tables 10, 11 and 12 */ /* Following is Left RAP, Centre RAP, Right RAP and Start Cluster from ISO/IEC 24728:2006 Tables 10, 11 and 12 */
INTERNAL_DATA const char zint_pdf_RAPTable[136] = { /*34*4*/ INTERNAL_DATA const char zint_pdf_RAPTable[136] = { /*34*4*/
1, 8, 36, 19, 9, 25, 1, 1, 8, 36, 19, 9, 27, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1, 47, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1, 1, 8, 36, 19, 9, 25, 1, 1, 8, 36, 19, 9, 27, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1, 47, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25, 19, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25, 19, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25,
+1
View File
@@ -230,6 +230,7 @@ static void qr_define_modes(char modes[], const unsigned int ddata[], const int
* - The above copyright notice and this permission notice shall be included in * - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software. * all copies or substantial portions of the Software.
*/ */
/* SPDX-License-Identifier: MIT */
unsigned int state[11] = { unsigned int state[11] = {
0 /*N*/, 0 /*A*/, 0 /*B*/, 0 /*K*/, /* Head/switch costs */ 0 /*N*/, 0 /*A*/, 0 /*B*/, 0 /*K*/, /* Head/switch costs */
0 /*version*/, 0 /*version*/,
+9 -9
View File
@@ -1,10 +1,10 @@
/* /*
This is a simple Reed-Solomon encoder This is a simple Reed-Solomon encoder
(C) Cliff Hones 2004 Copyright (C) Cliff Hones 2004
*/ */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2009-2026 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
@@ -251,17 +251,17 @@ INTERNAL void zint_rs_encode_uint(const rs_t *rs, const int datalen, const unsig
/* `logmod` (field characteristic) will be 2**bitlength - 1, eg 1023 for bitlength 10, 4095 for bitlength 12 */ /* `logmod` (field characteristic) will be 2**bitlength - 1, eg 1023 for bitlength 10, 4095 for bitlength 12 */
INTERNAL int zint_rs_uint_init_gf(rs_uint_t *rs_uint, const unsigned int prime_poly, const int logmod) { INTERNAL int zint_rs_uint_init_gf(rs_uint_t *rs_uint, const unsigned int prime_poly, const int logmod) {
int b, p, v; int b, p, v;
unsigned int *logt, *alog; unsigned short *logt, *alog;
b = logmod + 1; b = logmod + 1;
rs_uint->logt = NULL; rs_uint->logt = NULL;
rs_uint->alog = NULL; rs_uint->alog = NULL;
if (!(logt = (unsigned int *) calloc(b, sizeof(unsigned int)))) { if (!(logt = (unsigned short *) calloc(b, sizeof(unsigned short)))) {
return 0; return 0;
} }
if (!(alog = (unsigned int *) calloc(b * 2, sizeof(unsigned int)))) { if (!(alog = (unsigned short *) calloc(b * 2, sizeof(unsigned short)))) {
free(logt); free(logt);
return 0; return 0;
} }
@@ -282,8 +282,8 @@ INTERNAL int zint_rs_uint_init_gf(rs_uint_t *rs_uint, const unsigned int prime_p
INTERNAL void zint_rs_uint_init_code(rs_uint_t *rs_uint, const int nsym, int index) { INTERNAL void zint_rs_uint_init_code(rs_uint_t *rs_uint, const int nsym, int index) {
int i, k; int i, k;
const unsigned int *const logt = rs_uint->logt; const unsigned short *const logt = rs_uint->logt;
const unsigned int *const alog = rs_uint->alog; const unsigned short *const alog = rs_uint->alog;
unsigned short *rspoly = rs_uint->rspoly; unsigned short *rspoly = rs_uint->rspoly;
unsigned int *log_rspoly = rs_uint->log_rspoly; unsigned int *log_rspoly = rs_uint->log_rspoly;
@@ -315,8 +315,8 @@ INTERNAL void zint_rs_uint_init_code(rs_uint_t *rs_uint, const int nsym, int ind
INTERNAL void zint_rs_uint_encode(const rs_uint_t *rs_uint, const int datalen, const unsigned int *data, INTERNAL void zint_rs_uint_encode(const rs_uint_t *rs_uint, const int datalen, const unsigned int *data,
unsigned int *res) { unsigned int *res) {
int i, k; int i, k;
const unsigned int *const logt = rs_uint->logt; const unsigned short *const logt = rs_uint->logt;
const unsigned int *const alog = rs_uint->alog; const unsigned short *const alog = rs_uint->alog;
const unsigned short *const rspoly = rs_uint->rspoly; const unsigned short *const rspoly = rs_uint->rspoly;
const unsigned int *const log_rspoly = rs_uint->log_rspoly; const unsigned int *const log_rspoly = rs_uint->log_rspoly;
const int nsym = rs_uint->nsym; const int nsym = rs_uint->nsym;
+3 -3
View File
@@ -4,7 +4,7 @@
*/ */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2009-2026 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
@@ -51,8 +51,8 @@ typedef struct {
} rs_t; } rs_t;
typedef struct { typedef struct {
unsigned int *logt; /* These are malloced */ unsigned short *logt; /* These are malloced */
unsigned int *alog; unsigned short *alog;
unsigned short rspoly[4096]; /* Generated poly, 12-bit max - needs to be enlarged if > 12-bit used */ unsigned short rspoly[4096]; /* Generated poly, 12-bit max - needs to be enlarged if > 12-bit used */
unsigned int log_rspoly[4096]; /* Logs of poly */ unsigned int log_rspoly[4096]; /* Logs of poly */
int nsym; /* Degree of poly */ int nsym; /* Degree of poly */
+1
View File
@@ -30,6 +30,7 @@
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
#ifndef Z_SJIS_H #ifndef Z_SJIS_H
#define Z_SJIS_H #define Z_SJIS_H
+2 -2
View File
@@ -1,6 +1,6 @@
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2019-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2019-2026 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
@@ -45,7 +45,7 @@
INTERNAL int zint_test_u_gb18030_int(const unsigned int u, unsigned int *dest1, unsigned int *dest2); INTERNAL int zint_test_u_gb18030_int(const unsigned int u, unsigned int *dest1, unsigned int *dest2);
/* As control convert to GB 18030 using table generated from GB18030.TXT plus simple processing. /* As control convert to GB 18030 using table generated from GB18030.TXT plus simple processing.
The version of GB18030.TXT is jdk-1.4.2/GB18030.TXT taken from The version of GB18030.TXT is libiconv-1.11/GB18030.TXT taken from
https://haible.de/bruno/charsets/conversion-tables/GB18030.html https://haible.de/bruno/charsets/conversion-tables/GB18030.html
The generated file backend/tests/test_gb18030_tab.h does not include U+10000..10FFFF codepoints to save space. The generated file backend/tests/test_gb18030_tab.h does not include U+10000..10FFFF codepoints to save space.
See also backend/tests/tools/data/GB18030.TXT.README and backend/tests/tools/gen_test_tab.php. See also backend/tests/tools/data/GB18030.TXT.README and backend/tests/tools/gen_test_tab.php.
+1 -1
View File
@@ -2712,7 +2712,7 @@ static void test_input_mode(const testCtx *const p_ctx) {
/* 40*/ { BARCODE_AZTEC, "^1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 40*/ { BARCODE_AZTEC, "^1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
/* 41*/ { BARCODE_AZTEC, "1234", GS1_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 41*/ { BARCODE_AZTEC, "1234", GS1_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
/* 42*/ { BARCODE_AZTEC, "https://example.com/01/12345678901231", GS1_MODE, -1, 0, 0 }, /* 42*/ { BARCODE_AZTEC, "https://example.com/01/12345678901231", GS1_MODE, -1, 0, 0 },
/* 43*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* Codablock-F does not support GS1 */ /* 43*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* Codablock F does not support GS1 */
/* 44*/ { BARCODE_CODABLOCKF, "^0112345678901231", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* 44*/ { BARCODE_CODABLOCKF, "^0112345678901231", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
/* 45*/ { BARCODE_CODABLOCKF, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* 45*/ { BARCODE_CODABLOCKF, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
/* 46*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* 46*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+1 -1
View File
@@ -1036,7 +1036,7 @@ static void test_non_forced(const testCtx *const p_ctx) {
/* 32*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" }, /* 32*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
/* 33*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" }, /* 33*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
/* 34*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" }, /* 34*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
/* 35*/ { BARCODE_CODABLOCKF, GS1_MODE, -1, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" }, /* Codablock-F does not support GS1 */ /* 35*/ { BARCODE_CODABLOCKF, GS1_MODE, -1, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" }, /* Codablock F does not support GS1 */
/* 36*/ { BARCODE_CODABLOCKF, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" }, /* 36*/ { BARCODE_CODABLOCKF, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" },
/* 37*/ { BARCODE_CODABLOCKF, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" }, /* 37*/ { BARCODE_CODABLOCKF, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" },
/* 38*/ { BARCODE_CODEONE, GS1_MODE, -1, "[01]12345678901231", 0, "" }, /* 38*/ { BARCODE_CODEONE, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+39 -29
View File
@@ -280,9 +280,12 @@ static void test_reader_init(const testCtx *const p_ctx) {
const char *expected; const char *expected;
const char *comment; const char *comment;
}; };
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = { static const struct item data[] = {
/* 0*/ { BARCODE_PDF417, UNICODE_MODE, READER_INIT, "A", 0, 6, 103, "(12) 4 921 29 900 209 917 46 891 522 472 822 385", "Outputs Test Alpha flag 900" }, /* 0*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, READER_INIT, "A", 0, 6, 103, "(12) 4 921 29 900 209 917 46 891 522 472 822 385", "Outputs Test Alpha flag 900" },
/* 1*/ { BARCODE_MICROPDF417, UNICODE_MODE, READER_INIT, "A", 0, 11, 38, "(11) 921 900 29 900 179 499 922 262 777 478 300", "Outputs Test Alpha flag 900" }, /* 1*/ { BARCODE_PDF417, UNICODE_MODE, READER_INIT, "A", 0, 6, 103, "(12) 4 921 29 900 209 917 46 891 522 472 822 385", "Outputs Test Alpha flag 900" },
/* 2*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, READER_INIT, "A", 0, 11, 38, "(11) 921 900 29 900 179 499 922 262 777 478 300", "Outputs Test Alpha flag 900" },
/* 3*/ { BARCODE_MICROPDF417, UNICODE_MODE, READER_INIT, "A", 0, 11, 38, "(11) 921 900 29 900 179 499 922 262 777 478 300", "Outputs Test Alpha flag 900" },
}; };
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;
@@ -434,33 +437,40 @@ static void test_input(const testCtx *const p_ctx) {
/* 54*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 1, -1, { 0, 0, "" }, "A", 0, 0, 6, 86, "(6) 2 29 752 533 551 139", 0, "BWIPP BYTE1" }, /* 54*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 1, -1, { 0, 0, "" }, "A", 0, 0, 6, 86, "(6) 2 29 752 533 551 139", 0, "BWIPP BYTE1" },
/* 55*/ { BARCODE_PDF417, UNICODE_MODE, -1, 1, -1, { 0, 0, "" }, "A", 0, 0, 6, 86, "(6) 2 29 752 533 551 139", 0, "BWIPP BYTE1" }, /* 55*/ { BARCODE_PDF417, UNICODE_MODE, -1, 1, -1, { 0, 0, "" }, "A", 0, 0, 6, 86, "(6) 2 29 752 533 551 139", 0, "BWIPP BYTE1" },
/* 56*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 2, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", 0, "BWIPP BYTE1" }, /* 56*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 2, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", 0, "BWIPP BYTE1" },
/* 57*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 3, -1, { 0, 0, "" }, "A", 0, 0, 9, 103, "(18) 2 29 290 888 64 789 390 182 22 197 347 41 298 467 387 917 455 196", 0, "BWIPP BYTE1" }, /* 57*/ { BARCODE_PDF417, UNICODE_MODE, -1, 2, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", 0, "BWIPP BYTE1" },
/* 58*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 4, -1, { 0, 0, "" }, "A", 0, 0, 12, 120, "(36) 4 29 900 900 702 212 753 721 695 584 222 459 110 594 813 465 718 912 667 349 852 602", 0, "BWIPP BYTE1" }, /* 58*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 3, -1, { 0, 0, "" }, "A", 0, 0, 9, 103, "(18) 2 29 290 888 64 789 390 182 22 197 347 41 298 467 387 917 455 196", 0, "BWIPP BYTE1" },
/* 59*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 5, -1, { 0, 0, "" }, "A", 0, 0, 14, 154, "(70) 6 29 900 900 900 900 774 599 527 418 850 374 921 763 922 772 572 661 584 902 578 696", 0, "BWIPP BYTE1" }, /* 59*/ { BARCODE_PDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, "A", 0, 0, 9, 103, "(18) 2 29 290 888 64 789 390 182 22 197 347 41 298 467 387 917 455 196", 0, "BWIPP BYTE1" },
/* 60*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 6, -1, { 0, 0, "" }, "A", 0, 0, 19, 188, "(133) 5 29 900 900 900 113 261 822 368 600 652 404 869 860 902 184 702 611 323 195 794 566", 0, "BWIPP BYTE1" }, /* 60*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 4, -1, { 0, 0, "" }, "A", 0, 0, 12, 120, "(36) 4 29 900 900 702 212 753 721 695 584 222 459 110 594 813 465 718 912 667 349 852 602", 0, "BWIPP BYTE1" },
/* 61*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 7, -1, { 0, 0, "" }, "A", 0, 0, 29, 222, "(261) 5 29 900 900 900 384 614 456 20 422 177 78 492 215 859 765 864 755 572 621 891 97 538", 0, "BWIPP BYTE1" }, /* 61*/ { BARCODE_PDF417, UNICODE_MODE, -1, 4, -1, { 0, 0, "" }, "A", 0, 0, 12, 120, "(36) 4 29 900 900 702 212 753 721 695 584 222 459 110 594 813 465 718 912 667 349 852 602", 0, "BWIPP BYTE1" },
/* 62*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 0, 0, "" }, "A", 0, 0, 40, 290, "(520) 8 29 900 900 900 900 900 900 255 576 871 499 885 500 866 196 784 681 589 448 428 108", 0, "BWIPP BYTE1" }, /* 62*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 5, -1, { 0, 0, "" }, "A", 0, 0, 14, 154, "(70) 6 29 900 900 900 900 774 599 527 418 850 374 921 763 922 772 572 661 584 902 578 696", 0, "BWIPP BYTE1" },
/* 63*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" }, /* 63*/ { BARCODE_PDF417, UNICODE_MODE, -1, 5, -1, { 0, 0, "" }, "A", 0, 0, 14, 154, "(70) 6 29 900 900 900 900 774 599 527 418 850 374 921 763 922 772 572 661 584 902 578 696", 0, "BWIPP BYTE1" },
/* 64*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" }, /* 64*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 6, -1, { 0, 0, "" }, "A", 0, 0, 19, 188, "(133) 5 29 900 900 900 113 261 822 368 600 652 404 869 860 902 184 702 611 323 195 794 566", 0, "BWIPP BYTE1" },
/* 65*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" }, /* 65*/ { BARCODE_PDF417, UNICODE_MODE, -1, 6, -1, { 0, 0, "" }, "A", 0, 0, 19, 188, "(133) 5 29 900 900 900 113 261 822 368 600 652 404 869 860 902 184 702 611 323 195 794 566", 0, "BWIPP BYTE1" },
/* 66*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" }, /* 66*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 7, -1, { 0, 0, "" }, "A", 0, 0, 29, 222, "(261) 5 29 900 900 900 384 614 456 20 422 177 78 492 215 859 765 864 755 572 621 891 97 538", 0, "BWIPP BYTE1" },
/* 67*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" }, /* 67*/ { BARCODE_PDF417, UNICODE_MODE, -1, 7, -1, { 0, 0, "" }, "A", 0, 0, 29, 222, "(261) 5 29 900 900 900 384 614 456 20 422 177 78 492 215 859 765 864 755 572 621 891 97 538", 0, "BWIPP BYTE1" },
/* 68*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" }, /* 68*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 0, 0, "" }, "A", 0, 0, 40, 290, "(520) 8 29 900 900 900 900 900 900 255 576 871 499 885 500 866 196 784 681 589 448 428 108", 0, "BWIPP BYTE1" },
/* 69*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" }, /* 69*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 0, 0, "" }, "A", 0, 0, 40, 290, "(520) 8 29 900 900 900 900 900 900 255 576 871 499 885 500 866 196 784 681 589 448 428 108", 0, "BWIPP BYTE1" },
/* 70*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" }, /* 70*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" },
/* 71*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" }, /* 71*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" },
/* 72*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" }, /* 72*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" },
/* 73*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 4, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 928 111 103 17 53 923 1 111 104 922 837 837 774 835 701 445 926 428 285 851 334", 1, "H.4 example last segment" }, /* 73*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" },
/* 74*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" }, /* 74*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" },
/* 75*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" }, /* 75*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" },
/* 76*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" }, /* 76*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" },
/* 77*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" }, /* 77*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" },
/* 78*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 902 1 348 256 900 759 577 359 263 64 409 852 154", 0, "BWIPP BYTE" }, /* 78*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" },
/* 79*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 841 63 125 209 900 889 730 746 451 470 371 667 636", 1, "" }, /* 79*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" },
/* 80*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" }, /* 80*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 4, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 928 111 103 17 53 923 1 111 104 922 837 837 774 835 701 445 926 428 285 851 334", 1, "H.4 example last segment" },
/* 81*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" }, /* 81*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" },
/* 82*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" }, /* 82*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" },
/* 83*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" }, /* 83*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" },
/* 84*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" },
/* 85*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 902 1 348 256 900 759 577 359 263 64 409 852 154", 0, "BWIPP BYTE" },
/* 86*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 841 63 125 209 900 889 730 746 451 470 371 667 636", 1, "" },
/* 87*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" },
/* 88*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" },
/* 89*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" },
/* 90*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" },
}; };
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
int i, length, ret; int i, length, ret;
+166 -32
View File
@@ -51,15 +51,23 @@ struct perf_item {
}; };
static void test_perf(const testCtx *const p_ctx, const int default_iterations, const struct perf_item *data, static void test_perf(const testCtx *const p_ctx, const int default_iterations, const struct perf_item *data,
const int data_size) { const int data_size, const char *const outfile) {
int debug = p_ctx->debug; int debug = p_ctx->debug & 0xFFFF;
/* Hack (use "-d $((256 + (flg << 16)))") to select whether to time (`ZBarcode_Create()` always timed):
1. `ZBarcode_Encode()`
2. `ZBarcode_Buffer()`
4. `ZBarcode_Buffer()` with `OUT_BUFFER_INTERMEDIATE`
8. `ZBarcode_Print()`
16. `ZBarcode_Print()` with `BARCODE_MEMORY_FILE`
with 0 meaning all */
int flg = (p_ctx->debug >> 16) & 0xFF;
int i, length, ret; int i, length, ret;
struct zint_symbol *symbol = NULL; struct zint_symbol *symbol = NULL;
clock_t start; clock_t start;
clock_t total_create = 0, total_encode = 0, total_buffer = 0, total_buf_inter = 0, total_print = 0; clock_t total_create = 0, total_encode = 0, total_buffer = 0, total_buf_inter = 0, total_print = 0, total_memfile = 0;
clock_t diff_create, diff_encode, diff_buffer, diff_buf_inter, diff_print; clock_t diff_create, diff_encode, diff_buffer, diff_buf_inter, diff_print, diff_memfile;
int comment_max = 0; int comment_max = 0;
const int iterations = p_ctx->arg ? p_ctx->arg : default_iterations; /* Use "-a N" to set iterations */ const int iterations = p_ctx->arg ? p_ctx->arg : default_iterations; /* Use "-a N" to set iterations */
@@ -83,9 +91,10 @@ static void test_perf(const testCtx *const p_ctx, const int default_iterations,
if (testContinue(p_ctx, i)) continue; if (testContinue(p_ctx, i)) continue;
diff_create = diff_encode = diff_buffer = diff_buf_inter = diff_print = 0; diff_create = diff_encode = diff_buffer = diff_buf_inter = diff_print = 0, diff_memfile = 0;
for (j = 0; j < iterations; j++) { for (j = 0; j < iterations; j++) {
int have_encoded = 0;
start = clock(); start = clock();
symbol = ZBarcode_Create(); symbol = ZBarcode_Create();
diff_create += clock() - start; diff_create += clock() - start;
@@ -113,22 +122,35 @@ static void test_perf(const testCtx *const p_ctx, const int default_iterations,
data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/,
text, -1, debug); text, -1, debug);
if (!flg || (flg & 1)) {
start = clock(); start = clock();
ret = ZBarcode_Encode(symbol, TCU(text), length); ret = ZBarcode_Encode(symbol, TCU(text), length);
diff_encode += clock() - start; diff_encode += clock() - start;
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt); i, ret, data[i].ret, symbol->errtxt);
have_encoded = 1;
}
assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", if (!flg || (flg & 2)) {
i, symbol->rows, data[i].expected_rows, data[i].data); if (!have_encoded) {
assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", ret = ZBarcode_Encode(symbol, TCU(text), length);
i, symbol->width, data[i].expected_width, data[i].data); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
have_encoded = 1;
}
start = clock(); start = clock();
ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/); ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/);
diff_buffer += clock() - start; diff_buffer += clock() - start;
assert_zero(ret, "i:%d ZBarcode_Buffer ret %d != 0 (%s)\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Buffer ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
}
if (!flg || (flg & 4)) {
if (!have_encoded) {
ret = ZBarcode_Encode(symbol, TCU(text), length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
have_encoded = 1;
}
symbol->output_options |= OUT_BUFFER_INTERMEDIATE; symbol->output_options |= OUT_BUFFER_INTERMEDIATE;
start = clock(); start = clock();
ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/); ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/);
@@ -136,32 +158,68 @@ static void test_perf(const testCtx *const p_ctx, const int default_iterations,
assert_zero(ret, "i:%d ZBarcode_Buffer OUT_BUFFER_INTERMEDIATE ret %d != 0 (%s)\n", assert_zero(ret, "i:%d ZBarcode_Buffer OUT_BUFFER_INTERMEDIATE ret %d != 0 (%s)\n",
i, ret, symbol->errtxt); i, ret, symbol->errtxt);
symbol->output_options &= ~OUT_BUFFER_INTERMEDIATE; /* Undo */ symbol->output_options &= ~OUT_BUFFER_INTERMEDIATE; /* Undo */
}
if (!flg || (flg & 8)) {
if (!have_encoded) {
ret = ZBarcode_Encode(symbol, TCU(text), length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
have_encoded = 1;
}
if (outfile && strlen(outfile) < 256) {
strcpy(symbol->outfile, outfile);
}
start = clock(); start = clock();
ret = ZBarcode_Print(symbol, 0 /*rotate_angle*/); ret = ZBarcode_Print(symbol, 0 /*rotate_angle*/);
diff_print += clock() - start; diff_print += clock() - start;
assert_zero(ret, "i:%d ZBarcode_Print ret %d != 0 (%s)\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Print ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
assert_zero(testUtilRemove(symbol->outfile), "i:%d testUtilRemove(%s) != 0\n", i, symbol->outfile); assert_zero(testUtilRemove(symbol->outfile), "i:%d testUtilRemove(%s) != 0\n", i, symbol->outfile);
}
if (!flg || (flg & 16)) {
if (!have_encoded) {
ret = ZBarcode_Encode(symbol, TCU(text), length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
/*have_encoded = 1;*/
}
symbol->output_options |= BARCODE_MEMORY_FILE;
if (outfile && strlen(outfile) < 256) {
strcpy(symbol->outfile, outfile);
}
start = clock();
ret = ZBarcode_Print(symbol, 0 /*rotate_angle*/);
diff_memfile += clock() - start;
assert_zero(ret, "i:%d ZBarcode_Print BARCODE_MEMORY_FILE ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
symbol->output_options &= ~BARCODE_MEMORY_FILE; /* Undo */
}
assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n",
i, symbol->rows, data[i].expected_rows, data[i].data);
assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n",
i, symbol->width, data[i].expected_width, data[i].data);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
printf(" %*s: encode % 8gms, buffer % 8gms, buf_inter % 8gms, print % 8gms, create % 8gms\n", printf(" %*s: encode % 8gms, buffer % 8gms, buf_inter % 8gms, print % 8gms, memfile % 8gms, create % 8gms\n",
comment_max, data[i].comment, comment_max, data[i].comment,
TEST_PERF_TIME(diff_encode), TEST_PERF_TIME(diff_buffer), TEST_PERF_TIME(diff_buf_inter), TEST_PERF_TIME(diff_encode), TEST_PERF_TIME(diff_buffer), TEST_PERF_TIME(diff_buf_inter),
TEST_PERF_TIME(diff_print), TEST_PERF_TIME(diff_create)); TEST_PERF_TIME(diff_print), TEST_PERF_TIME(diff_memfile), TEST_PERF_TIME(diff_create));
total_create += diff_create; total_create += diff_create;
total_encode += diff_encode; total_encode += diff_encode;
total_buffer += diff_buffer; total_buffer += diff_buffer;
total_buf_inter += diff_buf_inter; total_buf_inter += diff_buf_inter;
total_print += diff_print; total_print += diff_print;
total_memfile += diff_memfile;
} }
if (p_ctx->index == -1) { if (p_ctx->index == -1) {
printf(" %*s: encode % 8gms, buffer % 8gms, buf_inter % 8gms, print % 8gms, create % 8gms\n", printf(" %*s: encode % 8gms, buffer % 8gms, buf_inter % 8gms, print % 8gms, memfile % 8gms, create % 8gms\n",
comment_max, "totals", comment_max, "totals",
TEST_PERF_TIME(total_encode), TEST_PERF_TIME(total_buffer), TEST_PERF_TIME(total_buf_inter), TEST_PERF_TIME(total_encode), TEST_PERF_TIME(total_buffer), TEST_PERF_TIME(total_buf_inter),
TEST_PERF_TIME(total_print), TEST_PERF_TIME(total_create)); TEST_PERF_TIME(total_print), TEST_PERF_TIME(total_memfile), TEST_PERF_TIME(total_create));
} }
testFinish(); testFinish();
@@ -178,7 +236,7 @@ static void test_2of5(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_aztec(const testCtx *const p_ctx) { static void test_aztec(const testCtx *const p_ctx) {
@@ -235,7 +293,7 @@ static void test_aztec(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 1 * 1000; const int default_iterations = 1 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_aztec_fast(const testCtx *const p_ctx) { static void test_aztec_fast(const testCtx *const p_ctx) {
@@ -292,7 +350,7 @@ static void test_aztec_fast(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 1 * 1000; const int default_iterations = 1 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_code11(const testCtx *const p_ctx) { static void test_code11(const testCtx *const p_ctx) {
@@ -304,7 +362,7 @@ static void test_code11(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_code128(const testCtx *const p_ctx) { static void test_code128(const testCtx *const p_ctx) {
@@ -317,7 +375,7 @@ static void test_code128(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_composite(const testCtx *const p_ctx) { static void test_composite(const testCtx *const p_ctx) {
@@ -344,7 +402,7 @@ static void test_composite(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 1 * 1000; const int default_iterations = 1 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_dmatrix(const testCtx *const p_ctx) { static void test_dmatrix(const testCtx *const p_ctx) {
@@ -424,7 +482,7 @@ static void test_dmatrix(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_dotcode(const testCtx *const p_ctx) { static void test_dotcode(const testCtx *const p_ctx) {
@@ -442,7 +500,7 @@ static void test_dotcode(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 1 * 1000; const int default_iterations = 1 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_gridmtx(const testCtx *const p_ctx) { static void test_gridmtx(const testCtx *const p_ctx) {
@@ -467,7 +525,7 @@ static void test_gridmtx(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 1 * 1000; const int default_iterations = 1 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_hanxin(const testCtx *const p_ctx) { static void test_hanxin(const testCtx *const p_ctx) {
@@ -509,7 +567,7 @@ static void test_hanxin(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 1 * 1000; const int default_iterations = 1 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_maxicode(const testCtx *const p_ctx) { static void test_maxicode(const testCtx *const p_ctx) {
@@ -532,7 +590,7 @@ static void test_maxicode(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 10 * 1000; const int default_iterations = 10 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_pdf417(const testCtx *const p_ctx) { static void test_pdf417(const testCtx *const p_ctx) {
@@ -582,7 +640,57 @@ static void test_pdf417(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
}
static void test_pdf417_fast(const testCtx *const p_ctx) {
static const struct perf_item data[] = {
/* 0*/ { BARCODE_PDF417, FAST_MODE, -1, -1, -1, "1234567890", "", 0, 7, 103, "10 numerics" },
/* 1*/ { BARCODE_PDF417, FAST_MODE, -1, -1, -1,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM"
"NOPQRSTUVWXYZ;<>@[]_`~!||()?{}'123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJK"
"LMNOPQRSTUVWXYZ12345678912345678912345678912345678900001234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFG"
"HIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567"
"890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcde"
"fghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO",
"", 0, 43, 290, "960 chars, text/numeric" },
/* 2*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1,
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240",
"", 0, 51, 358, "960 chars, byte" },
/* 3*/ { BARCODE_PDF417, FAST_MODE, -1, -1, -1,
"BP2D+1.00+0005+FLE ESC BV+1.00+3.60*BX2D+1.00+0001+Casual shoes & apparel+90044030118100801265*D_2D+1.02+31351440315981+C910332+02032018+KXXXX CXXXX+UNIT 4 HXXX"
"XXXXX BUSINESS PARK++ST ALBANS+ST ALBANS++AL2 3TA+0001+000001+001+00000000+00++N+N+N+0000++++++N+++N*DS2D+1.01+0001+0001+90044030118100801265+++++07852389322+"
"+E*F_2D+1.00+0005*",
"", 0, 26, 222, "338 chars, text/numeric/byte" },
};
const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_plessey(const testCtx *const p_ctx) { static void test_plessey(const testCtx *const p_ctx) {
@@ -596,7 +704,7 @@ static void test_plessey(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_postal(const testCtx *const p_ctx) { static void test_postal(const testCtx *const p_ctx) {
@@ -609,7 +717,7 @@ static void test_postal(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 10 * 1000; const int default_iterations = 10 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_qr(const testCtx *const p_ctx) { static void test_qr(const testCtx *const p_ctx) {
@@ -662,7 +770,7 @@ static void test_qr(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_qr_fast(const testCtx *const p_ctx) { static void test_qr_fast(const testCtx *const p_ctx) {
@@ -715,7 +823,7 @@ static void test_qr_fast(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_microqr(const testCtx *const p_ctx) { static void test_microqr(const testCtx *const p_ctx) {
@@ -729,7 +837,7 @@ static void test_microqr(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 5 * 1000; const int default_iterations = 5 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
} }
static void test_upcean(const testCtx *const p_ctx) { static void test_upcean(const testCtx *const p_ctx) {
@@ -749,7 +857,29 @@ static void test_upcean(const testCtx *const p_ctx) {
const int data_size = ARRAY_SIZE(data); const int data_size = ARRAY_SIZE(data);
const int default_iterations = 10 * 1000; const int default_iterations = 10 * 1000;
test_perf(p_ctx, default_iterations, data, data_size); test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
}
static void test_gif(const testCtx *const p_ctx) {
static const struct perf_item data[] = {
/* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, "123456ABCD", "", 0, 1, 123, "CODE128 10" },
};
const int data_size = ARRAY_SIZE(data);
const int default_iterations = 10 * 1000;
test_perf(p_ctx, default_iterations, data, data_size, "out.gif");
}
static void test_tif(const testCtx *const p_ctx) {
static const struct perf_item data[] = {
/* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, "123456ABCD", "", 0, 1, 123, "CODE128 10" },
};
const int data_size = ARRAY_SIZE(data);
const int default_iterations = 10 * 1000;
test_perf(p_ctx, default_iterations, data, data_size, "out.tif");
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@@ -767,12 +897,16 @@ int main(int argc, char *argv[]) {
{ "test_hanxin", test_hanxin }, { "test_hanxin", test_hanxin },
{ "test_maxicode", test_maxicode }, { "test_maxicode", test_maxicode },
{ "test_pdf417", test_pdf417 }, { "test_pdf417", test_pdf417 },
{ "test_pdf417_fast", test_pdf417_fast },
{ "test_plessey", test_plessey }, { "test_plessey", test_plessey },
{ "test_postal", test_postal }, { "test_postal", test_postal },
{ "test_qr", test_qr }, { "test_qr", test_qr },
{ "test_qr_fast", test_qr_fast }, { "test_qr_fast", test_qr_fast },
{ "test_microqr", test_microqr }, { "test_microqr", test_microqr },
{ "test_upcean", test_upcean }, { "test_upcean", test_upcean },
{ "test_gif", test_gif },
{ "test_tif", test_tif },
}; };
testRun(argc, argv, funcs, ARRAY_SIZE(funcs)); testRun(argc, argv, funcs, ARRAY_SIZE(funcs));
+2 -2
View File
@@ -1,6 +1,6 @@
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2020-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2020-2026 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
@@ -34,7 +34,7 @@
INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf); INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf);
/* For overview when debugging: ./test_tiff -f pixel_plot -d 5 */ /* For overview when debugging: ./test_tif -f pixel_plot -d 5 */
static void test_pixel_plot(const testCtx *const p_ctx) { static void test_pixel_plot(const testCtx *const p_ctx) {
int debug = p_ctx->debug; int debug = p_ctx->debug;
+1 -1
View File
@@ -32,7 +32,7 @@
* Copyright (C) 2006-2017 Kentaro Fukuchi <kentaro@fukuchi.org> * Copyright (C) 2006-2017 Kentaro Fukuchi <kentaro@fukuchi.org>
*/ */
/* Due to above: */ /* Due to above: */
/* SPDX-License-Identifier: LGPL-2.1+ */ /* SPDX-License-Identifier: LGPL-2.0-or-later */
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
Binary file not shown.
+2 -2
View File
@@ -2,7 +2,7 @@
/* Generate lookup table from unicode.org mapping file (SHIFTJIS.TXT by default). */ /* Generate lookup table from unicode.org mapping file (SHIFTJIS.TXT by default). */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2019-2022 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2019-2026 Robin Stuart <rstuart114@gmail.com>
*/ */
/* To create backend/tests/test_sjis_tab.h (from the project root directory): /* To create backend/tests/test_sjis_tab.h (from the project root directory):
* *
@@ -18,7 +18,7 @@
* *
* To create backend/tests/test_gb18030_tab.h (note that backend/tests/tools/data/GB18030.TXT * To create backend/tests/test_gb18030_tab.h (note that backend/tests/tools/data/GB18030.TXT
* will have to be downloaded first from https://haible.de/bruno/charsets/conversion-tables/GB18030.html * will have to be downloaded first from https://haible.de/bruno/charsets/conversion-tables/GB18030.html
* using the version jdk-1.4.2/GB18030.TXT): * using the version libiconv-1.11/GB18030.TXT):
* *
* php backend/tests/tools/gen_test_tab.php -f GB18030.TXT -s gb18030_tab * php backend/tests/tools/gen_test_tab.php -f GB18030.TXT -s gb18030_tab
* *
+142 -19
View File
@@ -38,7 +38,6 @@
#include "filemem.h" #include "filemem.h"
#include "output.h" #include "output.h"
#include "tif.h" #include "tif.h"
#include "tif_lzw.h"
/* PhotometricInterpretation */ /* PhotometricInterpretation */
#define TIF_PMI_WHITEISZERO 0 #define TIF_PMI_WHITEISZERO 0
@@ -51,13 +50,13 @@
#define TIF_NO_COMPRESSION 1 #define TIF_NO_COMPRESSION 1
#define TIF_LZW 5 #define TIF_LZW 5
static void to_color_map(const unsigned char rgb[4], tiff_color_t *color_map_entry) { static void tif_to_color_map(const unsigned char rgb[4], tiff_color_t *color_map_entry) {
color_map_entry->red = (rgb[0] << 8) | rgb[0]; color_map_entry->red = (rgb[0] << 8) | rgb[0];
color_map_entry->green = (rgb[1] << 8) | rgb[1]; color_map_entry->green = (rgb[1] << 8) | rgb[1];
color_map_entry->blue = (rgb[2] << 8) | rgb[2]; color_map_entry->blue = (rgb[2] << 8) | rgb[2];
} }
static void to_cmyk(const char *colour, unsigned char *cmyk) { static void tif_to_cmyk(const char *colour, unsigned char *cmyk) {
int cyan, magenta, yellow, black; int cyan, magenta, yellow, black;
unsigned char alpha; unsigned char alpha;
@@ -69,6 +68,134 @@ static void to_cmyk(const char *colour, unsigned char *cmyk) {
cmyk[4] = alpha; cmyk[4] = alpha;
} }
/* LZW stuff - see `tif_lzw_compress()` below */
#define TIF_LZW_CLEAR_CODE 256
#define TIF_LZW_EOI_CODE 257 /* EndOfInformation */
#define TIF_LZW_MIN_BITS 9
#define TIF_LZW_MAX_BITS 12
#define TIF_LZW_TABLE_SIZE 4096 /* (1 << TIF_LZW_MAX_BITS) */
/* Write `code` to output `fmp` in 8-bit batches, returning updated `bytes_put` */
static int tif_lzw_putCode(struct filemem *fmp, const int code, const int bitsPerCode, int *p_bits, int bytes_put) {
int bits = *p_bits & 0x0FFF; /* Actual bits in buffer */
int num_bits = (*p_bits >> 16) & 0x0FFF; /* No. of bits in buffer */
bits = (bits << bitsPerCode) | code;
for (num_bits += bitsPerCode; num_bits >= 8; num_bits -= 8) {
zint_fm_putc((bits >> (num_bits - 8)) & 0xFF, fmp);
bytes_put++;
}
bits &= (1 << num_bits) - 1;
*p_bits = (num_bits << 16) | bits;
return bytes_put;
}
/* LZW compression adapted from TwelveMonkeys ImageIO's `LZWEncoder::encode()`, returns no. of bytes written */
/* Copyright (c) 2015, Harald Kuhr */
/* SPDX-License-Identifier: BSD-3-Clause */
/* Tree algorithm from "LZW Compression Used to Encode/Decode a GIF File", Bob Montgomery, 1988, see
https://gingko.homeip.net/docs/file_formats/lzwgif.html#bob
"manuscript in public domain" according to "Encyclopedia of Graphics File Formats" (2nd edition, 1996)
by James D. Murray and William vanRyper, Chapter 9 "Data Compression", p.178
*/
static int tif_lzw_compress(struct filemem *fmp, const unsigned char *bp, const unsigned int blen) {
short suffixes[TIF_LZW_TABLE_SIZE] = {0}; /* "shade[]" in Montgomery diagram */
/* A child is made up of a parent (or prefix) code plus a suffix byte
and siblings are strings with a common parent (or prefix) and different suffix bytes */
short children[TIF_LZW_TABLE_SIZE] = {0}; /* "child[]" in Montgomery diagram */
short siblings[TIF_LZW_TABLE_SIZE] = {0}; /* "sib[]" in Montgomery diagram */
int parent;
int bitsPerCode = TIF_LZW_MIN_BITS; /* "codesize" in Montgomery diagram, goes from 9 to 12 */
int nextValidCode = TIF_LZW_EOI_CODE + 1; /* "nvc" - next available slot in `suffixes` */
int maxCode = (1 << bitsPerCode) - 1; /* If `nextValidCode` hits this, `bitsPerCode` will have to be adjusted */
int bits = 0; /* Buffer for partial codes, top 16-bits no. of bits, bottom the bits */
int bytes_put = 0; /* No. of bytes output */
const unsigned char *const be = bp + blen;
assert(blen != 0);
/* Init */
bytes_put = tif_lzw_putCode(fmp, TIF_LZW_CLEAR_CODE & maxCode, bitsPerCode, &bits, bytes_put);
parent = *bp++; /* Parent is 1st code */
while (bp < be) {
const int value = *bp++; /* "color" in Montgomery diagram */
int child = children[parent];
/* Does parent have a child? */
if (child) {
/* Is child right value? */
if (suffixes[child] == value) {
parent = child; /* Make new parent */
} else {
int sibling = child; /* Makes loop easier */
/* Try siblings */
for (;;) {
/* Does sibling have a sibling? */
if (siblings[sibling]) {
sibling = siblings[sibling];
/* Is sibling right value? */
if (suffixes[sibling] == value) {
parent = sibling; /* Make new parent */
break;
}
} else {
/* Create one */
siblings[sibling] = (short) nextValidCode;
goto update_child; /* Hack to avoid having func with large no. of args */
}
}
}
/* Parent does not have a child */
} else {
/* Create one */
children[parent] = (short) nextValidCode;
update_child:
suffixes[nextValidCode] = (short) value;
bytes_put = tif_lzw_putCode(fmp, parent & maxCode, bitsPerCode, &bits, bytes_put); /* Put the code */
parent = value;
if (++nextValidCode > maxCode) {
/* Adjust `bitsPerCode` (code size) if required */
if (bitsPerCode == TIF_LZW_MAX_BITS) {
/* Signal reset by writing Clear code */
bytes_put = tif_lzw_putCode(fmp, TIF_LZW_CLEAR_CODE & maxCode, bitsPerCode, &bits, bytes_put);
/* Reset tables */
memset(children, 0, sizeof(short) * TIF_LZW_TABLE_SIZE);
memset(siblings, 0, sizeof(short) * TIF_LZW_TABLE_SIZE);
bitsPerCode = TIF_LZW_MIN_BITS;
nextValidCode = TIF_LZW_EOI_CODE + 1;
} else {
/* Increase code size */
bitsPerCode++;
}
maxCode = (1 << bitsPerCode) - 1;
}
}
}
/* Write EOI when we are done */
bytes_put = tif_lzw_putCode(fmp, parent & maxCode, bitsPerCode, &bits, bytes_put);
bytes_put = tif_lzw_putCode(fmp, TIF_LZW_EOI_CODE & maxCode, bitsPerCode, &bits, bytes_put);
/* Flush partial codes */
if (bits) {
const int num_bits = (bits >> 16) & 0x0FFF;
zint_fm_putc((bits << (8 - num_bits)) & 0xFF, fmp); /* Zero pad */
bytes_put++;
}
return bytes_put;
}
/* TIFF Revision 6.0 https://www.adobe.io/content/dam/udp/en/open/standards/tiff/TIFF6.pdf */ /* TIFF Revision 6.0 https://www.adobe.io/content/dam/udp/en/open/standards/tiff/TIFF6.pdf */
INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char *pixelbuf) { INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char *pixelbuf) {
unsigned char fg[4], bg[4]; unsigned char fg[4], bg[4];
@@ -94,7 +221,6 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
struct filemem *const fmp = &fm; struct filemem *const fmp = &fm;
const unsigned char *pb; const unsigned char *pb;
int compression = TIF_NO_COMPRESSION; int compression = TIF_NO_COMPRESSION;
tif_lzw_state lzw_state;
long file_pos; long file_pos;
const int output_to_stdout = symbol->output_options & BARCODE_STDOUT; const int output_to_stdout = symbol->output_options & BARCODE_STDOUT;
uint32_t *strip_offset; uint32_t *strip_offset;
@@ -134,9 +260,9 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
palette[i][4] = fg[3]; palette[i][4] = fg[3];
} }
map['0'] = 8; map['0'] = 8;
to_cmyk(symbol->bgcolour, palette[8]); tif_to_cmyk(symbol->bgcolour, palette[8]);
map['1'] = 9; map['1'] = 9;
to_cmyk(symbol->fgcolour, palette[9]); tif_to_cmyk(symbol->fgcolour, palette[9]);
pmi = TIF_PMI_SEPARATED; pmi = TIF_PMI_SEPARATED;
bits_per_sample = 8; bits_per_sample = 8;
@@ -171,7 +297,7 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
if (fg[3] == 0xff && bg[3] == 0xff) { /* If no alpha */ if (fg[3] == 0xff && bg[3] == 0xff) { /* If no alpha */
pmi = TIF_PMI_PALETTE_COLOR; pmi = TIF_PMI_PALETTE_COLOR;
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
to_color_map(palette[i], &color_map[i]); tif_to_color_map(palette[i], &color_map[i]);
} }
bits_per_sample = 4; bits_per_sample = 4;
samples_per_pixel = 1; samples_per_pixel = 1;
@@ -188,9 +314,9 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
} else { /* fg/bg only */ } else { /* fg/bg only */
if (symbol->output_options & CMYK_COLOUR) { if (symbol->output_options & CMYK_COLOUR) {
map['0'] = 0; map['0'] = 0;
to_cmyk(symbol->bgcolour, palette[0]); tif_to_cmyk(symbol->bgcolour, palette[0]);
map['1'] = 1; map['1'] = 1;
to_cmyk(symbol->fgcolour, palette[1]); tif_to_cmyk(symbol->fgcolour, palette[1]);
pmi = TIF_PMI_SEPARATED; pmi = TIF_PMI_SEPARATED;
bits_per_sample = 8; bits_per_sample = 8;
@@ -227,7 +353,7 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
pmi = TIF_PMI_PALETTE_COLOR; pmi = TIF_PMI_PALETTE_COLOR;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
to_color_map(palette[i], &color_map[i]); tif_to_color_map(palette[i], &color_map[i]);
} }
if (fg[3] == 0xff && bg[3] == 0xff) { /* If no alpha */ if (fg[3] == 0xff && bg[3] == 0xff) { /* If no alpha */
bits_per_sample = 4; bits_per_sample = 4;
@@ -316,7 +442,6 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
} }
if (!output_to_stdout) { if (!output_to_stdout) {
compression = TIF_LZW; compression = TIF_LZW;
tif_lzw_init(&lzw_state);
} }
/* Header */ /* Header */
@@ -370,13 +495,13 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
if (strip_row == rows_per_strip || (strip == strip_count - 1 && strip_row == rows_last_strip)) { if (strip_row == rows_per_strip || (strip == strip_count - 1 && strip_row == rows_last_strip)) {
/* End of strip */ /* End of strip */
if (compression == TIF_LZW) { if (compression == TIF_LZW) {
#ifndef NDEBUG
file_pos = zint_fm_tell(fmp); file_pos = zint_fm_tell(fmp);
if (!tif_lzw_encode(&lzw_state, fmp, strip_buf, bytes_put)) { /* Only fails if can't malloc */ #endif
tif_lzw_cleanup(&lzw_state); bytes_put = tif_lzw_compress(fmp, strip_buf, bytes_put);
(void) zint_fm_close(fmp, symbol); #ifndef NDEBUG
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 673, "Insufficient memory for TIF LZW hash table"); assert(bytes_put == (unsigned int) (zint_fm_tell(fmp) - file_pos));
} #endif
bytes_put = (unsigned int) (zint_fm_tell(fmp) - file_pos);
if (bytes_put != strip_bytes[strip]) { if (bytes_put != strip_bytes[strip]) {
const int diff = bytes_put - strip_bytes[strip]; const int diff = bytes_put - strip_bytes[strip];
strip_bytes[strip] = bytes_put; strip_bytes[strip] = bytes_put;
@@ -402,8 +527,6 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
} }
if (compression == TIF_LZW) { if (compression == TIF_LZW) {
tif_lzw_cleanup(&lzw_state);
file_pos = zint_fm_tell(fmp); file_pos = zint_fm_tell(fmp);
zint_fm_seek(fmp, 4, SEEK_SET); zint_fm_seek(fmp, 4, SEEK_SET);
free_memory = file_pos; free_memory = file_pos;
-382
View File
@@ -1,382 +0,0 @@
/* tif_lzw.h - LZW compression for TIFF */
/*
libzint - the open source barcode library
Copyright (C) 2021-2025 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the project nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef Z_TIF_LZW_H
#define Z_TIF_LZW_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Adapted from TIFF Library 4.2.0 libtiff/tif_lzw.c */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
/*
* TIFF Library.
* Rev 5.0 Lempel-Ziv & Welch Compression Support
*
* This code is derived from the compress program whose code is
* derived from software contributed to Berkeley by James A. Woods,
* derived from original work by Spencer Thomas and Joseph Orost.
*
* The original Berkeley copyright notice appears below in its entirety.
*/
/*
* Copyright (c) 1985, 1986 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* James A. Woods, derived from original work by Spencer Thomas
* and Joseph Orost.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#define MAXCODE(n) ((1L << (n)) - 1)
/*
* The TIFF spec specifies that encoded bit
* strings range from 9 to 12 bits.
*/
#define BITS_MIN 9 /* start with 9 bits */
#define BITS_MAX 12 /* max of 12 bit strings */
/* predefined codes */
#define CODE_CLEAR 256 /* code to clear string table */
#define CODE_EOI 257 /* end-of-information code */
#define CODE_FIRST 258 /* first free code entry */
#define CODE_MAX MAXCODE(BITS_MAX)
#define HSIZE 9001L /* 91% occupancy */
#define HSHIFT (13 - 8)
/*
* Encoding-specific state.
*/
typedef uint16_t tif_lzw_hcode; /* codes fit in 16 bits */
typedef struct {
long hash;
tif_lzw_hcode code;
} tif_lzw_hash;
#define CHECK_GAP 10000 /* ratio check interval */
/*
* State block.
*/
typedef struct {
tif_lzw_hash *enc_hashtab; /* kept separate for small machines */
} tif_lzw_state;
/*
* LZW Encoding.
*/
/*
* Reset encoding hash table.
*/
static void tif_lzw_cl_hash(tif_lzw_state *sp) {
register tif_lzw_hash *hp = &sp->enc_hashtab[HSIZE - 1];
register long i = HSIZE - 8;
do {
i -= 8;
hp[-7].hash = -1;
hp[-6].hash = -1;
hp[-5].hash = -1;
hp[-4].hash = -1;
hp[-3].hash = -1;
hp[-2].hash = -1;
hp[-1].hash = -1;
hp[ 0].hash = -1;
hp -= 8;
} while (i >= 0);
for (i += 8; i > 0; i--, hp--) {
hp->hash = -1;
}
}
#define CALCRATIO(sp, rat) { \
if (incount > 0x007fffff) { /* NB: shift will overflow */ \
rat = outcount >> 8; \
rat = (rat == 0 ? 0x7fffffff : incount / rat); \
} else \
rat = (incount << 8) / outcount; \
}
/* Explicit 0xff masking to make icc -check=conversions happy */
#define PutNextCode(op_fmp, c) { \
nextdata = (nextdata << nbits) | c; \
nextbits += nbits; \
zint_fm_putc((nextdata >> (nextbits - 8)) & 0xff, op_fmp); \
nextbits -= 8; \
if (nextbits >= 8) { \
zint_fm_putc((nextdata >> (nextbits - 8)) & 0xff, op_fmp); \
nextbits -= 8; \
} \
outcount += nbits; \
}
/*
* Encode a chunk of pixels.
*
* Uses an open addressing double hashing (no chaining) on the
* prefix code/next character combination. We do a variant of
* Knuth's algorithm D (vol. 3, sec. 6.4) along with G. Knott's
* relatively-prime secondary probe. Here, the modular division
* first probe is gives way to a faster exclusive-or manipulation.
* Also do block compression with an adaptive reset, whereby the
* code table is cleared when the compression ratio decreases,
* but after the table fills. The variable-length output codes
* are re-sized at this point, and a CODE_CLEAR is generated
* for the decoder.
*/
static int tif_lzw_encode(tif_lzw_state *sp, struct filemem *op_fmp, const unsigned char *bp, int cc) {
register long fcode;
register tif_lzw_hash *hp;
register int h, c;
tif_lzw_hcode ent;
long disp;
int nbits; /* # of bits/code */
int maxcode; /* maximum code for nbits */
int free_ent; /* next free entry in hash table */
unsigned long nextdata; /* next bits of i/o */
long nextbits; /* # of valid bits in nextdata */
long checkpoint; /* point at which to clear table */
long ratio; /* current compression ratio */
long incount; /* (input) data bytes encoded */
long outcount; /* encoded (output) bytes */
/*
* Reset encoding state at the start of a strip.
*/
if (sp->enc_hashtab == NULL) {
sp->enc_hashtab = (tif_lzw_hash *) malloc(HSIZE * sizeof(tif_lzw_hash));
if (sp->enc_hashtab == NULL) {
return 0;
}
}
tif_lzw_cl_hash(sp); /* clear hash table */
nbits = BITS_MIN;
maxcode = MAXCODE(BITS_MIN);
free_ent = CODE_FIRST;
nextdata = 0;
nextbits = 0;
checkpoint = CHECK_GAP;
ratio = 0;
incount = 0;
outcount = 0;
ent = (tif_lzw_hcode) -1;
if (cc > 0) {
PutNextCode(op_fmp, CODE_CLEAR);
ent = *bp++; cc--; incount++;
}
while (cc > 0) {
c = *bp++; cc--; incount++;
fcode = ((long)c << BITS_MAX) + ent;
h = (c << HSHIFT) ^ ent; /* xor hashing */
#ifdef _WINDOWS
/*
* Check hash index for an overflow.
*/
if (h >= HSIZE) {
h -= HSIZE;
}
#endif
hp = &sp->enc_hashtab[h];
if (hp->hash == fcode) {
ent = hp->code;
continue;
}
if (hp->hash >= 0) {
/*
* Primary hash failed, check secondary hash.
*/
disp = HSIZE - h;
if (h == 0) {
disp = 1;
}
do {
/*
* Avoid pointer arithmetic because of
* wraparound problems with segments.
*/
if ((h -= disp) < 0) {
h += HSIZE;
}
hp = &sp->enc_hashtab[h];
if (hp->hash == fcode) {
ent = hp->code;
goto hit;
}
} while (hp->hash >= 0);
}
/*
* New entry, emit code and add to table.
*/
PutNextCode(op_fmp, ent);
ent = (tif_lzw_hcode) c;
hp->code = (tif_lzw_hcode) (free_ent++);
hp->hash = fcode;
if (free_ent == CODE_MAX - 1) {
/* table is full, emit clear code and reset */
tif_lzw_cl_hash(sp);
ratio = 0;
incount = 0;
outcount = 0;
free_ent = CODE_FIRST;
PutNextCode(op_fmp, CODE_CLEAR);
nbits = BITS_MIN;
maxcode = MAXCODE(BITS_MIN);
} else {
/*
* If the next entry is going to be too big for
* the code size, then increase it, if possible.
*/
if (free_ent > maxcode) {
nbits++;
assert(nbits <= BITS_MAX);
maxcode = (int) MAXCODE(nbits);
} else if (incount >= checkpoint) {
long rat;
/*
* Check compression ratio and, if things seem
* to be slipping, clear the hash table and
* reset state. The compression ratio is a
* 24+8-bit fractional number.
*/
checkpoint = incount + CHECK_GAP;
CALCRATIO(sp, rat);
if (rat <= ratio) {
tif_lzw_cl_hash(sp);
ratio = 0;
incount = 0;
outcount = 0;
free_ent = CODE_FIRST;
PutNextCode(op_fmp, CODE_CLEAR);
nbits = BITS_MIN;
maxcode = MAXCODE(BITS_MIN);
} else {
ratio = rat;
}
}
}
hit:
;
}
/*
* Finish off an encoded strip by flushing the last
* string and tacking on an End Of Information code.
*/
if (ent != (tif_lzw_hcode) -1) {
PutNextCode(op_fmp, ent);
free_ent++;
if (free_ent == CODE_MAX - 1) {
/* table is full, emit clear code and reset */
outcount = 0;
PutNextCode(op_fmp, CODE_CLEAR);
nbits = BITS_MIN;
} else {
/*
* If the next entry is going to be too big for
* the code size, then increase it, if possible.
*/
if (free_ent > maxcode) {
nbits++;
assert(nbits <= BITS_MAX);
}
}
}
PutNextCode(op_fmp, CODE_EOI);
/* Explicit 0xff masking to make icc -check=conversions happy */
if (nextbits > 0) {
zint_fm_putc((nextdata << (8 - nextbits)) & 0xff, op_fmp);
}
return 1;
}
static void tif_lzw_cleanup(tif_lzw_state *sp) {
if (sp->enc_hashtab) {
free(sp->enc_hashtab);
}
}
static void tif_lzw_init(tif_lzw_state *sp) {
sp->enc_hashtab = NULL;
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
/* vim: set ts=4 sw=4 et : */
#endif /* Z_TIF_LZW_H */
+4 -3
View File
@@ -2,7 +2,7 @@
/* Generate ECI multibyte tables from unicode.org mapping files */ /* Generate ECI multibyte tables from unicode.org mapping files */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2022-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2022-2026 Robin Stuart <rstuart114@gmail.com>
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* /*
@@ -12,7 +12,7 @@
* *
* NOTE: backend/tools/data/GB18030.TXT will have to be downloaded first from the tarball * NOTE: backend/tools/data/GB18030.TXT will have to be downloaded first from the tarball
* https://haible.de/bruno/charsets/conversion-tables/GB18030.tar.bz2 * https://haible.de/bruno/charsets/conversion-tables/GB18030.tar.bz2
* using the version jdk-1.4.2/GB18030.TXT * using the version libiconv-1.11/GB18030.TXT
* *
* NOTE: tools/data/GB2312.TXT will have to be downloaded first from the tarball * NOTE: tools/data/GB2312.TXT will have to be downloaded first from the tarball
* https://haible.de/bruno/charsets/conversion-tables/GB2312.tar.bz2 * https://haible.de/bruno/charsets/conversion-tables/GB2312.tar.bz2
@@ -48,6 +48,7 @@ $copyright_text = <<<'EOD'
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
EOD; EOD;
@@ -573,7 +574,7 @@ file_put_contents($out_dirname . '/gbk.h', implode("\n", $out) . "\n");
$out = array(); $out = array();
out_header($out, 'gb18030', 'GB 18030-2005', 'jdk-1.4.2/GB18030.TXT', 2016, out_header($out, 'gb18030', 'GB 18030-2005', 'libiconv-1.11/GB18030.TXT', 2016,
'(see https://haible.de/bruno/charsets/conversion-tables/GB18030.tar.bz2)'); '(see https://haible.de/bruno/charsets/conversion-tables/GB18030.tar.bz2)');
$file = $data_dirname . '/' . 'GB18030.TXT'; $file = $data_dirname . '/' . 'GB18030.TXT';
+3 -2
View File
@@ -2,7 +2,7 @@
/* Generate ECI single-byte tables & routines from unicode.org mapping files */ /* Generate ECI single-byte tables & routines from unicode.org mapping files */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2022-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2022-2026 Robin Stuart <rstuart114@gmail.com>
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* /*
@@ -26,7 +26,7 @@ $head = <<<'EOD'
"https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP125*.TXT" */ "https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP125*.TXT" */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2021-2025 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2021-2026 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
@@ -54,6 +54,7 @@ $head = <<<'EOD'
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-License-Identifier: Unicode-3.0 */
#ifndef Z_ECI_SB_H #ifndef Z_ECI_SB_H
#define Z_ECI_SB_H #define Z_ECI_SB_H
+2 -2
View File
@@ -212,7 +212,7 @@ extern "C" {
#define BARCODE_DATAMATRIX 71 /* Data Matrix (ECC200) */ #define BARCODE_DATAMATRIX 71 /* Data Matrix (ECC200) */
#define BARCODE_EAN14 72 /* EAN-14 */ #define BARCODE_EAN14 72 /* EAN-14 */
#define BARCODE_VIN 73 /* Vehicle Identification Number */ #define BARCODE_VIN 73 /* Vehicle Identification Number */
#define BARCODE_CODABLOCKF 74 /* Codablock-F */ #define BARCODE_CODABLOCKF 74 /* Codablock F */
#define BARCODE_NVE18 75 /* NVE-18 (SSCC-18) */ #define BARCODE_NVE18 75 /* NVE-18 (SSCC-18) */
#define BARCODE_JAPANPOST 76 /* Japanese Postal Code */ #define BARCODE_JAPANPOST 76 /* Japanese Postal Code */
#define BARCODE_KOREAPOST 77 /* Korea Post */ #define BARCODE_KOREAPOST 77 /* Korea Post */
@@ -244,7 +244,7 @@ extern "C" {
#define BARCODE_HIBC_QR 104 /* HIBC QR Code */ #define BARCODE_HIBC_QR 104 /* HIBC QR Code */
#define BARCODE_HIBC_PDF 106 /* HIBC PDF417 */ #define BARCODE_HIBC_PDF 106 /* HIBC PDF417 */
#define BARCODE_HIBC_MICPDF 108 /* HIBC MicroPDF417 */ #define BARCODE_HIBC_MICPDF 108 /* HIBC MicroPDF417 */
#define BARCODE_HIBC_BLOCKF 110 /* HIBC Codablock-F */ #define BARCODE_HIBC_BLOCKF 110 /* HIBC Codablock F */
#define BARCODE_HIBC_AZTEC 112 /* HIBC Aztec Code */ #define BARCODE_HIBC_AZTEC 112 /* HIBC Aztec Code */
/* Tbarcode 10 codes */ /* Tbarcode 10 codes */
+13 -3
View File
@@ -1,4 +1,14 @@
zint (2.6.0) stable; urgency=medium zint (2.16.0.9-1) unstable; urgency=low
* Updated using https://salsa.debian.org/debian/zint as template, props
Dmitry Smirnov <onlyjob@debian.org>
* Ticket #147, props John Crisp
* TODO: enable building with the GS1 Syntax Engine
* TODO: "libzint2.16.symbols" file?
-- Robin Stuart <rstuart114@gmail.com> Wed, 18 Mar 2026 13:00:00 +0000
zint (2.6.0-1) stable; urgency=medium
* Update to Qt5 * Update to Qt5
* Output to EMF and TIF * Output to EMF and TIF
@@ -9,7 +19,7 @@ zint (2.5.1) UNRELEASED; urgency=medium
* Include support for DotCode * Include support for DotCode
* Include support for Han Xin (Chinese Sensible) code. * Include support for Han Xin (Chinese Sensible) code.
* Reinstate Codablock-F support. * Reinstate Codablock F support.
* Automated ECI pre-processing. * Automated ECI pre-processing.
* Output to BMP, GIF and PCX. * Output to BMP, GIF and PCX.
* Huge code review and numerous bugfixes * Huge code review and numerous bugfixes
@@ -47,7 +57,7 @@ zint (2.3.2) unstable; urgency=low
zint (2.3.1) unstable; urgency=low zint (2.3.1) unstable; urgency=low
* Removed Codablock-F. * Removed Codablock F.
* Redesigned scale function so that human readable text and Maxicode * Redesigned scale function so that human readable text and Maxicode
symbols can be scaled consistently. symbols can be scaled consistently.
* Corrected encoding bugs with Code 128/Code 16k and Data Matrix ECC * Corrected encoding bugs with Code 128/Code 16k and Data Matrix ECC
-1
View File
@@ -1 +0,0 @@
9
+106 -29
View File
@@ -1,42 +1,119 @@
Source: zint Source: zint
Section: libs Section: graphics
Priority: optional Priority: optional
Maintainer: Robin Stuart <rstuart114@gmail.com> Maintainer: Robin Stuart <rstuart114@gmail.com>
Build-Depends: debhelper (>= 9), cmake, libpng12-dev, libqt4-dev Build-Depends: debhelper-compat (= 12)
Standards-Version: 3.9.1 ,cmake
Homepage: http://www.zint.org.uk/ ,libpng-dev
,libqt5svg5-dev
,qtbase5-dev
,qttools5-dev
Standards-Version: 4.6.2
Homepage: https://www.zint.org.uk/
Rules-Requires-Root: no
Package: zint Package: zint
Section: libs
Architecture: any Architecture: any
Description: A library for encoding data in barcode symbols. Depends: ${shlibs:Depends}, ${misc:Depends}
Zint is an Open Source barcode encoding and image generating library. Description: command line utility for encoding data in barcode symbols
It currently features support for over 50 symbologies including Zint is a barcode generator library. It features support for over 50
QR Code, Data Matrix, Aztec Code, Code 128, UPC/EAN, HIBC, GS1 DataBar and many others. symbologies, including Australian Post, Aztec Code & Runes, BC412,
Also included are Unicode translation for symbologies which support Latin-1 and Kanji character sets, Channel, Codabar, Codablock F, Code 11, Code 128, Code 16K, Code 2 of
full GS1 data support including verification and automated insertion of FNC1 characters and 5 (IATA, Interleaved, Data Logic, ITF-14, Deutsche Post Leitcode &
support for encoding binary data including NULL (ASCII 0) characters. Identcode), Code 32 (Italian Pharmacode), Code 39 & Code 39 Extended,
Code 49, Code 93, Code One, DAFT, Data Matrix (incl. DMRE), DotCode,
Package: zint-devel DPD, Dutch Post KIX, EAN, FIM, Flattermarken, Grid Matrix, GS1 DataBar
Section: libdevel (incl. stacked & GS1 Composite symbols), GS1-128, Han Xin, HIBC, ISBN,
Architecture: any Japan Post, Korea Post, LOGMARS, MaxiCode, NVE-18 (SSCC-18), PDF417 &
Depends: zint (= ${binary:Version}) MicroPDF417, Pharmacode, PLANET, POSTNET, Plessey (MSI & UK), PZN, QR
Description: Zint development files Code, Micro QR & rMQR, Royal Mail RM4SCC & Mailmark, Telepen,
This package contains development files for the Zint barcode encoding Ultracode, UPC-A, UPC-E, UPNQR, UPU S10, USPS Intelligent Mail and
library. VIN.
.
Also included are Unicode translation for all ECI character sets, full
GS1 data support including verification and automated insertion of
FNC1 characters and support for encoding binary data. Output can be
saved as BMP, EMF, EPS, GIF, PCX, PNG, SVG and TIFF.
.
This package contains Zint Barcode Generator (command line utility).
Package: zint-qt Package: zint-qt
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Zint Barcode Studio, a Qt frontend to zint
Zint is a barcode generator library. It features support for over 50
symbologies, including Australian Post, Aztec Code & Runes, BC412,
Channel, Codabar, Codablock F, Code 11, Code 128, Code 16K, Code 2 of
5 (IATA, Interleaved, Data Logic, ITF-14, Deutsche Post Leitcode &
Identcode), Code 32 (Italian Pharmacode), Code 39 & Code 39 Extended,
Code 49, Code 93, Code One, DAFT, Data Matrix (incl. DMRE), DotCode,
DPD, Dutch Post KIX, EAN, FIM, Flattermarken, Grid Matrix, GS1 DataBar
(incl. stacked & GS1 Composite symbols), GS1-128, Han Xin, HIBC, ISBN,
Japan Post, Korea Post, LOGMARS, MaxiCode, NVE-18 (SSCC-18), PDF417 &
MicroPDF417, Pharmacode, PLANET, POSTNET, Plessey (MSI & UK), PZN, QR
Code, Micro QR & rMQR, Royal Mail RM4SCC & Mailmark, Telepen,
Ultracode, UPC-A, UPC-E, UPNQR, UPU S10, USPS Intelligent Mail and
VIN.
.
Also included are Unicode translation for all ECI character sets, full
GS1 data support including verification and automated insertion of
FNC1 characters and support for encoding binary data. Output can be
saved as BMP, EMF, EPS, GIF, PCX, PNG, SVG and TIFF.
.
This package contains Zint Barcode Studio, a Qt frontend for the Zint
barcode generator library.
Package: libzint2.16
Section: libs Section: libs
Architecture: any Architecture: any
Depends: zint (= ${binary:Version}) Multi-Arch: same
Description: Zint Barcode Studio. Depends: ${shlibs:Depends}, ${misc:Depends}
This package contains Zint Barcode Studio, a QT frontend for the Zint Description: library for encoding data in barcode symbols
barcode encoding library. Zint is a barcode generator library. It features support for over 50
symbologies, including Australian Post, Aztec Code & Runes, BC412,
Channel, Codabar, Codablock F, Code 11, Code 128, Code 16K, Code 2 of
5 (IATA, Interleaved, Data Logic, ITF-14, Deutsche Post Leitcode &
Identcode), Code 32 (Italian Pharmacode), Code 39 & Code 39 Extended,
Code 49, Code 93, Code One, DAFT, Data Matrix (incl. DMRE), DotCode,
DPD, Dutch Post KIX, EAN, FIM, Flattermarken, Grid Matrix, GS1 DataBar
(incl. stacked & GS1 Composite symbols), GS1-128, Han Xin, HIBC, ISBN,
Japan Post, Korea Post, LOGMARS, MaxiCode, NVE-18 (SSCC-18), PDF417 &
MicroPDF417, Pharmacode, PLANET, POSTNET, Plessey (MSI & UK), PZN, QR
Code, Micro QR & rMQR, Royal Mail RM4SCC & Mailmark, Telepen,
Ultracode, UPC-A, UPC-E, UPNQR, UPU S10, USPS Intelligent Mail and
VIN.
.
Also included are Unicode translation for all ECI character sets, full
GS1 data support including verification and automated insertion of
FNC1 characters and support for encoding binary data. Output can be
saved as BMP, EMF, EPS, GIF, PCX, PNG, SVG and TIFF.
.
This package provides the Zint barcode generator library.
Package: zint-qt-devel Package: libzint-dev
Section: libdevel Section: libdevel
Architecture: any Architecture: any
Depends: zint (= ${binary:Version}), zint-qt (= ${source:Version}), libqt4-dev Depends: libzint2.16 (= ${binary:Version}), ${misc:Depends}
Description: QZint development files. Multi-Arch: same
This package contains development files for the Qt wrapper over the Zint Description: Zint development files
library. Zint is a barcode generator library. It features support for over 50
symbologies, including Australian Post, Aztec Code & Runes, BC412,
Channel, Codabar, Codablock F, Code 11, Code 128, Code 16K, Code 2 of
5 (IATA, Interleaved, Data Logic, ITF-14, Deutsche Post Leitcode &
Identcode), Code 32 (Italian Pharmacode), Code 39 & Code 39 Extended,
Code 49, Code 93, Code One, DAFT, Data Matrix (incl. DMRE), DotCode,
DPD, Dutch Post KIX, EAN, FIM, Flattermarken, Grid Matrix, GS1 DataBar
(incl. stacked & GS1 Composite symbols), GS1-128, Han Xin, HIBC, ISBN,
Japan Post, Korea Post, LOGMARS, MaxiCode, NVE-18 (SSCC-18), PDF417 &
MicroPDF417, Pharmacode, PLANET, POSTNET, Plessey (MSI & UK), PZN, QR
Code, Micro QR & rMQR, Royal Mail RM4SCC & Mailmark, Telepen,
Ultracode, UPC-A, UPC-E, UPNQR, UPU S10, USPS Intelligent Mail and
VIN.
.
Also included are Unicode translation for all ECI character sets, full
GS1 data support including verification and automated insertion of
FNC1 characters and support for encoding binary data. Output can be
saved as BMP, EMF, EPS, GIF, PCX, PNG, SVG and TIFF.
.
This package contains development files for the Zint barcode generator
library and for the Qt wrapper over the Zint library.
+445 -23
View File
@@ -1,40 +1,462 @@
This package was debianized by: Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Zint Barcode Generator
BogDan Vatra <bogdan@licentia.eu> on Sat, 11 Apr 2009 23:45:53 +0300 Upstream-Contact: Robin Stuart <rstuart114@gmail.com>
Modified by Robin Stuart <rstuart114@gmail.com> on Fri, 13 Jan 2017 21:12:00 +0000 Source: https://sourceforge.net/projects/zint/
It was downloaded from:
<http://www.sourceforge.net/projects/zint>
Upstream Author(s):
Robin Stuart <rstuart114@gmail.com>
Files: *
Copyright: Copyright:
Copyright (C) 2006-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2014-2026 Harald Oehlmann <oehhar@users.sourceforge.net>
Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu >
Copyright (C) 2006-2017 Kentaro Fukuchi <fukuchi@megaui.net>
License: GPL-3.0-or-later
<Copyright (C) 2006-2017 Robin Stuart> Files: backend/*
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2014-2026 Harald Oehlmann <oehhar@users.sourceforge.net>
Copyright (C) Cliff Hones 2004
Copyright (c) 2004 Adrian Kennard, Andrews & Arnold Ltd
Copyright (c) 2006 Stefan Schmidt <stefan@datenfreihafen.org>
Copyright (C) 2016 Zoe Stuart
Copyright (C) 2006-2009 United States Postal Service
License: BSD-3-Clause
License: Files:
backend/aztec.c
backend/gs1.c
backend/fonts/normal_ttf.h
backend/fonts/normal_woff2.h
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright 2013 ZXing authors
Copyright 2016 Huy Cuong Nguyen
Copyright (c) 2024 GS1 AISBL.
Copyright 2013 Steve Matteson
License: BSD-3-Clause and Apache-2.0
Files:
backend/fonts/upcean_ttf.h
backend/fonts/upcean_woff2.h
Copyright:
Copyright (C) 2023 Robin Stuart <rstuart114@gmail.com>
Copyright Matthew Skala (2011)
License: BSD-3-Clause and Metafont-deriv
You may freely use, modify, and/or distribute any of these files or the
resulting fonts, without limitation.
Files:
backend/fonts/OCRB-16.bdf
backend/fonts/OCRB-18.bdf
Copyright:
Copyright Matthew Skala (2011)
License: Metafont-permissive
As far as the digitization in METAFONT input which I have developed, you
may freely use, modify, and/or distribute any of these files or the
resulting fonts, without limitation.
Files:
backend/big5.h
backend/eci_sb.h
backend/gb18030.h
backend/gb2312.h
backend/gbk.h
backend/ksx1001.h
backend/sjis.h
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright © 1991-2023 Unicode, Inc.
License: BSD-3-Clause and Unicode-3.0
Files:
backend/channel.c
backend/composite.c
backend/common.c
backend/gridmtx.c
backend/hanxin.c
backend/qr.*
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (c) AIM 1997
Copyright (c) 2004-2026 Terry Burton
Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
Copyright (c) Project Nayuki
License: BSD-3-Clause and MIT
Files:
backend/pcx.c
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright 1999-2013 ImageMagick Studio LLC
License: BSD-3-Clause and ImageMagick
Files:
backend/pdf417.c
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2004 (Grandzebu).
License: BSD-3-Clause and GPL-2.0-or-later
Files:
docs/lua-crossrefs/lua-crossrefs.lua
getopt/*
Copyright:
Copyright (C) 2025-2026 Robin Stuart <rstuart114@gmail.com>
Copyright © 2025 R. N. West.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
License: GPL-2.0-or-later
Files:
backend/tests/testcommon.*
Copyright:
Copyright (C) 2019-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2006-2017 Kentaro Fukuchi <kentaro@fukuchi.org>
License: LGPL-2.0-or-later
Files:
frontend/main.c
Copyright:
Copyright (C) 2008-2026 Robin Stuart <rstuart114@gmail.com>
Copyright 2002 Jon Griffiths
Copyright 2016 Sebastian Lackner
License: GPL-3.0-or-later and LGPL-2.1-or-later
Files:
frontend_qt/res/black-eye.svg
frontend_qt/res/check.svg
frontend_qt/res/copy.svg
frontend_qt/res/delete.svg
frontend_qt/res/download.svg
frontend_qt/res/help-circle.svg
frontend_qt/res/menu.svg
frontend_qt/res/shuffle.svg
frontend_qt/res/white-eye.svg
frontend_qt/res/x.svg
frontend_qt/res/zap.svg
Copyright:
Copyright (c) 2013-2022 Cole Bemis
License: MIT
Files:
frontend_qt/res/folder.svg
frontend_qt/res/monitor-bg.svg
frontend_qt/res/scaling.svg
Copyright:
Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
License: ISC
Files: debian/*
Copyright:
2013-2025 Dmitry Smirnov <onlyjob@debian.org>
License: GPL-3.0-or-later
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
On Debian systems, the complete text of the Apache License,
Version 2.0 can be found in "/usr/share/common-licenses/Apache-2.0".
License: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the project nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: GPL-2.0-or-later
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
On Debian systems, the complete text of the GNU General Public
License Version 2 can be found in "/usr/share/common-licenses/GPL-2".
License: GPL-3.0-or-later
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This package is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
On Debian systems, the complete text of the GNU General Public
License Version 3 can be found in "/usr/share/common-licenses/GPL-3".
You should have received a copy of the GNU General Public License License: ImageMagick
along with this program. If not, see <http://www.gnu.org/licenses/>. 1. Definitions.
License shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
.
Licensor shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
.
Legal Entity shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, control means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
.
You (or Your) shall mean an individual or Legal Entity exercising permissions
granted by this License.
.
Source form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and
configuration files.
.
Object form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object
code, generated documentation, and conversions to other media types.
.
Work shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is
included in or attached to the work (an example is provided in the Appendix
below).
.
Derivative Works shall mean any work, whether in Source or Object form, that is
based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
.
Contribution shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the
copyright owner as Not a Contribution.
.
Contributor shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
.
2. Grant of Copyright License. Subject to the terms and conditions of this
License, each Contributor hereby grants to You a perpetual, worldwide,
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
reproduce, prepare Derivative Works of, publicly display, publicly perform,
sublicense, and distribute the Work and such Derivative Works in Source or
Object form.
.
3. Grant of Patent License. Subject to the terms and conditions of this
License, each Contributor hereby grants to You a perpetual, worldwide,
non-exclusive, no-charge, royalty-free, irrevocable patent license to make,
have made, use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable by such
Contributor that are necessarily infringed by their Contribution(s) alone or by
combination of their Contribution(s) with the Work to which such
Contribution(s) was submitted. If You institute patent litigation against any
entity (including a cross-claim or counterclaim in a lawsuit) alleging that the
Work or a Contribution incorporated within the Work constitutes direct or
contributory patent infringement, then any patent licenses granted to You under
this License for that Work shall terminate as of the date such litigation is
filed.
.
4. Redistribution. You may reproduce and distribute copies of the Work or
Derivative Works thereof in any medium, with or without modifications, and in
Source or Object form, provided that You meet the following conditions:
.
a. You must give any other recipients of the Work or Derivative Works a
copy of this License; and
.
b. You must cause any modified files to carry prominent notices stating
that You changed the files; and
.
c. You must retain, in the Source form of any Derivative Works that You
distribute, all copyright, patent, trademark, and attribution notices from
the Source form of the Work, excluding those notices that do not pertain to
any part of the Derivative Works; and
.
d. If the Work includes a "NOTICE" text file as part of its distribution,
then any Derivative Works that You distribute must include a readable copy
of the attribution notices contained within such NOTICE file, excluding
those notices that do not pertain to any part of the Derivative Works, in
at least one of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or documentation,
if provided along with the Derivative Works; or, within a display generated
by the Derivative Works, if and wherever such third-party notices normally
appear. The contents of the NOTICE file are for informational purposes only
and do not modify the License. You may add Your own attribution notices
within Derivative Works that You distribute, alongside or as an addendum to
the NOTICE text from the Work, provided that such additional attribution
notices cannot be construed as modifying the License.
.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a
whole, provided Your use, reproduction, and distribution of the Work otherwise
complies with the conditions stated in this License.
.
5. Submission of Contributions. Unless You explicitly state otherwise, any
Contribution intentionally submitted for inclusion in the Work by You to the
Licensor shall be under the terms and conditions of this License, without any
additional terms or conditions. Notwithstanding the above, nothing herein shall
supersede or modify the terms of any separate license agreement you may have
executed with Licensor regarding such Contributions.
.
6. Trademarks. This License does not grant permission to use the trade names,
trademarks, service marks, or product names of the Licensor, except as required
for reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
writing, Licensor provides the Work (and each Contributor provides its
Contributions) on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied, including, without limitation, any warranties or
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any risks
associated with Your exercise of permissions under this License.
.
8. Limitation of Liability. In no event and under no legal theory, whether in
tort (including negligence), contract, or otherwise, unless required by
applicable law (such as deliberate and grossly negligent acts) or agreed to in
writing, shall any Contributor be liable to You for damages, including any
direct, indirect, special, incidental, or consequential damages of any
character arising as a result of this License or out of the use or inability to
use the Work (including but not limited to damages for loss of goodwill, work
stoppage, computer failure or malfunction, or any and all other commercial
damages or losses), even if such Contributor has been advised of the
possibility of such damages.
.
9. Accepting Warranty or Additional Liability. While redistributing the Work or
Derivative Works thereof, You may choose to offer, and charge a fee for,
acceptance of support, warranty, indemnity, or other liability obligations
and/or rights consistent with this License. However, in accepting such
obligations, You may act only on Your own behalf and on Your sole
responsibility, not on behalf of any other Contributor, and only if You agree
to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
On Debian systems, the complete text of the GNU General License: ISC
Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. Permission to use, copy, modify, and /or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
The Debian packaging is: License: MIT
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Copyright (C) 2010-2017 Robin Stuart <rstuart114@gmail.com> License: LGPL-2.0-or-later
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
On Debian systems, the complete text of the GNU Library General Public
License Version 2 can be found in "/usr/share/common-licenses/LGPL-2".
and is licensed under the GPL version 3, see above. License: LGPL-2.1-or-later
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
On Debian systems, the complete text of the GNU Library General Public
License Version 2 can be found in "/usr/share/common-licenses/LGPL-2.1".
License: Unicode-3.0
NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING,
INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR SOFTWARE, YOU
UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS
OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY,
DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
.
Permission is hereby granted, free of charge, to any person obtaining a copy of
data files and any associated documentation (the "Data Files") or software and
any associated documentation (the "Software") to deal in the Data Files or
Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of the Data Files
or Software, and to permit persons to whom the Data Files or Software are
furnished to do so, provided that either (a) this copyright and permission
notice appear with all copies of the Data Files or Software, or (b) this
copyright and permission notice appear in associated Documentation.
.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
PARTY RIGHTS.
.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
.
Except as contained in this notice, the name of a copyright holder shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
these Data Files or Software without prior written authorization of the
copyright holder.
+4
View File
@@ -0,0 +1,4 @@
usr/include
usr/lib/*/*.so
usr/lib/*/cmake/zint/*.cmake usr/share/zint/
cmake/modules/FindZint.cmake usr/share/apps/cmake/modules/
+1
View File
@@ -0,0 +1 @@
/usr/lib/*/libzint.so.*
+1
View File
@@ -0,0 +1 @@
usr/lib/*/libQZint.a
+10 -1
View File
@@ -1,3 +1,12 @@
#!/usr/bin/make -f #!/usr/bin/make -f
# vim: set ts=4 sw=4 noet :
%: %:
dh $@ dh $@ --buildsystem=cmake
# https://bugs-devel.debian.org/cgi-bin/bugreport.cgi?bug=1016936
override_dh_dwz:
# This is just to avoid a "no dependency information" error if have local non-package lib builds
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
-2
View File
@@ -1,2 +0,0 @@
usr/include/zint.h
usr/lib/libzint.so
-2
View File
@@ -1,2 +0,0 @@
usr/include/qzint.h
usr/lib/libQZint.so
+3 -1
View File
@@ -1,2 +1,4 @@
usr/lib/libQZint.so.*
usr/bin/zint-qt usr/bin/zint-qt
usr/share/man/man1/zint-qt.1
*.desktop /usr/share/applications
zint-qt.png /usr/share/pixmaps
+1 -1
View File
@@ -1,2 +1,2 @@
usr/lib/libzint.so.*
usr/bin/zint usr/bin/zint
usr/share/man/man1/zint.1
+15 -4
View File
@@ -1,9 +1,13 @@
# Makefile for generating "manual.txt" and "manual.pdf" from "manual.pmd" and "zint.1" from "zint.1.pmd" using pandoc # Makefile for generating:
# Copyright (C) 2022-2025 <rstuart114@gmail.com> # "manual.html", "manual.pdf" and "manual.txt" from "manual.pmd"
# "zint.1" from "zint.1.pmd"
# "zint-qt.1" from "zint-qt.1.pmd"
# using pandoc
# Copyright (C) 2022-2026 <rstuart114@gmail.com>
# vim: set ts=4 sw=4 noet : # vim: set ts=4 sw=4 noet :
# #
# Requires pandoc >= 3.8.2, plus xelatex and various other packages - see "README" # Requires pandoc >= 3.8.2, plus xelatex and various other packages - see "README"
# .svg images generated by "zint_images.sh" # "images/*.svg" generated by "zint_images.sh"
SOURCE = manual.pmd SOURCE = manual.pmd
OUT_PDF = manual.pdf OUT_PDF = manual.pdf
@@ -17,6 +21,8 @@ INCLUDES_TXT = inc_header_txt.tex
INC_TXT = --include-in-header $(INCLUDES_TXT) INC_TXT = --include-in-header $(INCLUDES_TXT)
SOURCE_MAN_PAGE = zint.1.pmd SOURCE_MAN_PAGE = zint.1.pmd
OUT_MAN_PAGE = zint.1 OUT_MAN_PAGE = zint.1
SOURCE_QT_MAN_PAGE = zint-qt.1.pmd
OUT_QT_MAN_PAGE = zint-qt.1
LUA_FILTER = lua-crossrefs/lua-crossrefs.lua LUA_FILTER = lua-crossrefs/lua-crossrefs.lua
INFRASTRUCTURE = Makefile $(LUA_FILTER) $(HIGHLIGHT_THEME) INFRASTRUCTURE = Makefile $(LUA_FILTER) $(HIGHLIGHT_THEME)
IMAGES = \ IMAGES = \
@@ -160,7 +166,7 @@ TXT_OPTS = --lua-filter=$(LUA_FILTER) \
--columns 80 --eol=lf -t plain --columns 80 --eol=lf -t plain
MAN_PAGE_OPTS = -s -t man MAN_PAGE_OPTS = -s -t man
all : $(OUT_PDF) $(OUT_TXT) $(OUT_MAN_PAGE) $(OUT_HTML) all : $(OUT_PDF) $(OUT_TXT) $(OUT_MAN_PAGE) $(OUT_QT_MAN_PAGE) $(OUT_HTML)
$(OUT_PDF) : $(SOURCE) $(SOURCE_MAN_PAGE) $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) $(IMAGES) $(INFRASTRUCTURE) $(OUT_PDF) : $(SOURCE) $(SOURCE_MAN_PAGE) $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) $(IMAGES) $(INFRASTRUCTURE)
pandoc $(SOURCE_MAN_PAGE) -f markdown \ pandoc $(SOURCE_MAN_PAGE) -f markdown \
@@ -195,6 +201,11 @@ $(OUT_MAN_PAGE) : $(SOURCE_MAN_PAGE) $(INFRASTRUCTURE)
$(MAN_PAGE_OPTS) \ $(MAN_PAGE_OPTS) \
-o $(OUT_MAN_PAGE) -o $(OUT_MAN_PAGE)
$(OUT_QT_MAN_PAGE) : $(SOURCE_QT_MAN_PAGE) $(INFRASTRUCTURE)
pandoc $(SOURCE_QT_MAN_PAGE) -f markdown \
$(MAN_PAGE_OPTS) \
-o $(OUT_QT_MAN_PAGE)
# For debugging # For debugging
manual.tex : $(SOURCE) $(SOURCE_MAN_PAGE) $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) $(IMAGES) $(INFRASTRUCTURE) manual.tex : $(SOURCE) $(SOURCE_MAN_PAGE) $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) $(IMAGES) $(INFRASTRUCTURE)
+3 -2
View File
@@ -1,7 +1,8 @@
% docs/README 2026-03-11 % docs/README 2026-03-17
For generation of "docs/manual.html", "docs/manual.pdf" and "docs/manual.txt" from "manual.pmd" For generation of "docs/manual.html", "docs/manual.pdf" and "docs/manual.txt" from "manual.pmd"
and man page "docs/zint.1" from "docs/zint.1.pmd" using pandoc >= 3.8.2. and man pages "docs/zint.1" from "docs/zint.1.pmd" and "docs/zint-qt.1" from "docs/zint-qt.1.pmd"
using pandoc >= 3.8.2.
On Ubuntu/Debian (tested on Ubuntu 22.04 and Ubuntu 24.04) On Ubuntu/Debian (tested on Ubuntu 22.04 and Ubuntu 24.04)
+2 -2
View File
@@ -1,8 +1,8 @@
-- libzint - the open source barcode library -- libzint - the open source barcode library
-- Copyright (C) 2025 Robin Stuart <rstuart114@gmail.com> -- Copyright (C) 2025-2026 Robin Stuart <rstuart114@gmail.com>
-- Hacked from https://github.com/rnwst/pandoc-lua-crossrefs -- Hacked from https://github.com/rnwst/pandoc-lua-crossrefs
-- © 2025 R. N. West. Released under the GPL version 2 or greater. -- Copyright © 2025 R. N. West. Released under the GPL version 2 or greater.
-- SPDX-License-Identifier: GPL-2.0-or-later -- SPDX-License-Identifier: GPL-2.0-or-later
PANDOC_VERSION:must_be_at_least '3.8.2' PANDOC_VERSION:must_be_at_least '3.8.2'
+32 -20
View File
@@ -504,6 +504,7 @@ id="toc-utf-8-to-eci-convenience-functions">5.17 UTF-8 to ECI
convenience functions</a></li> convenience functions</a></li>
<li><a href="#zint-version" id="toc-zint-version">5.18 Zint <li><a href="#zint-version" id="toc-zint-version">5.18 Zint
Version</a></li> Version</a></li>
<li><a href="#debug-info" id="toc-debug-info">5.19 Debug Info</a></li>
</ul></li> </ul></li>
<li><a href="#types-of-symbology" id="toc-types-of-symbology">6. Types <li><a href="#types-of-symbology" id="toc-types-of-symbology">6. Types
of Symbology</a> of Symbology</a>
@@ -631,8 +632,8 @@ Stacked Symbologies</a>
<ul> <ul>
<li><a href="#basic-symbol-stacking" <li><a href="#basic-symbol-stacking"
id="toc-basic-symbol-stacking">6.2.1 Basic Symbol Stacking</a></li> id="toc-basic-symbol-stacking">6.2.1 Basic Symbol Stacking</a></li>
<li><a href="#codablock-f" id="toc-codablock-f">6.2.2 <li><a href="#codablock-f" id="toc-codablock-f">6.2.2 Codablock
Codablock-F</a></li> F</a></li>
<li><a href="#code-16k-en-12323" id="toc-code-16k-en-12323">6.2.3 Code <li><a href="#code-16k-en-12323" id="toc-code-16k-en-12323">6.2.3 Code
16K (EN 12323)</a></li> 16K (EN 12323)</a></li>
<li><a href="#pdf417-iso-15438" id="toc-pdf417-iso-15438">6.2.4 PDF417 <li><a href="#pdf417-iso-15438" id="toc-pdf417-iso-15438">6.2.4 PDF417
@@ -1866,7 +1867,7 @@ DataBar Truncated)</td>
<tr> <tr>
<td style="text-align: left;">74</td> <td style="text-align: left;">74</td>
<td style="text-align: left;"><code>BARCODE_CODABLOCKF</code></td> <td style="text-align: left;"><code>BARCODE_CODABLOCKF</code></td>
<td style="text-align: left;">Codablock-F</td> <td style="text-align: left;">Codablock F</td>
</tr> </tr>
<tr> <tr>
<td style="text-align: left;">75</td> <td style="text-align: left;">75</td>
@@ -1986,7 +1987,7 @@ DataBar Truncated)</td>
<tr> <tr>
<td style="text-align: left;">110</td> <td style="text-align: left;">110</td>
<td style="text-align: left;"><code>BARCODE_HIBC_BLOCKF</code></td> <td style="text-align: left;"><code>BARCODE_HIBC_BLOCKF</code></td>
<td style="text-align: left;">HIBC Codablock-F</td> <td style="text-align: left;">HIBC Codablock F</td>
</tr> </tr>
<tr> <tr>
<td style="text-align: left;">112</td> <td style="text-align: left;">112</td>
@@ -2154,7 +2155,7 @@ class="sourceCode bash"><code class="sourceCode bash"><span id="cb25-1"><a href=
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="ex">Warning</span> 247: Height not compliant with standards</span></code></pre></div> <span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="ex">Warning</span> 247: Height not compliant with standards</span></code></pre></div>
<p>Another switch is <code>--heightperrow</code>, which can be useful <p>Another switch is <code>--heightperrow</code>, which can be useful
for symbologies that have a variable number of linear rows, namely for symbologies that have a variable number of linear rows, namely
Codablock-F, Code 16K, Code 49, GS1 DataBar Expanded Stacked, Codablock F, Code 16K, Code 49, GS1 DataBar Expanded Stacked,
MicroPDF417 and PDF417, as it changes the treatment of the height value MicroPDF417 and PDF417, as it changes the treatment of the height value
from overall height to per-row height, allowing you to specify a from overall height to per-row height, allowing you to specify a
consistent height for each linear row without having to know how many consistent height for each linear row without having to know how many
@@ -2193,7 +2194,7 @@ class="sourceCode bash"><code class="sourceCode bash"><span id="cb29-1"><a href=
zones compliant with the symbologys specification. This is in addition zones compliant with the symbologys specification. This is in addition
to any whitespace specified with the <code>--whitesp</code> or to any whitespace specified with the <code>--whitesp</code> or
<code>--vwhitesp</code> switches.</p> <code>--vwhitesp</code> switches.</p>
<p>Note that Codablock-F, Code 16K, Code 49, ITF-14, EAN-13, EAN-8, <p>Note that Codablock F, Code 16K, Code 49, ITF-14, EAN-13, EAN-8,
EAN/UPC add-ons, ISBN, UPC-A and UPC-E have compliant quiet zones added EAN/UPC add-ons, ISBN, UPC-A and UPC-E have compliant quiet zones added
by default. This can be disabled with the option by default. This can be disabled with the option
<code>--noquietzones</code>.</p> <code>--noquietzones</code>.</p>
@@ -2231,7 +2232,7 @@ alt="zint -b QRCODE --border=1 --box -d &quot;This Text&quot; --quietzones" />
<figcaption><span class="figure-label">Figure 16:</span> <figcaption><span class="figure-label">Figure 16:</span>
<code>zint -b QRCODE --border=1 --box -d "This Text" --quietzones</code></figcaption> <code>zint -b QRCODE --border=1 --box -d "This Text" --quietzones</code></figcaption>
</figure> </figure>
<p>Codablock-F, Code 16K and Code 49 always have boundary bars, and <p>Codablock F, Code 16K and Code 49 always have boundary bars, and
default to particular horizontal whitespace values. Special default to particular horizontal whitespace values. Special
considerations apply to ITF-14 and DPD - see <a href="#itf-14">6.1.2.6 considerations apply to ITF-14 and DPD - see <a href="#itf-14">6.1.2.6
ITF-14</a> and <a href="#dpd-code">6.1.10.7 DPD Code</a> for those ITF-14</a> and <a href="#dpd-code">6.1.10.7 DPD Code</a> for those
@@ -2506,7 +2507,7 @@ Sets</caption>
<td>None</td> <td>None</td>
</tr> </tr>
<tr> <tr>
<td style="text-align: left;">Codablock-F</td> <td style="text-align: left;">Codablock F</td>
<td style="text-align: left;">Latin-1</td> <td style="text-align: left;">Latin-1</td>
<td>None</td> <td>None</td>
</tr> </tr>
@@ -2602,7 +2603,7 @@ Modes and ECI</a> below.</p>
href="#gs1-data-entry-and-options">4.11.3 GS1 Data Entry and href="#gs1-data-entry-and-options">4.11.3 GS1 Data Entry and
Options</a>.</p> Options</a>.</p>
<p>Health Industry Barcode (HIBC) data may be encoded in the symbologies <p>Health Industry Barcode (HIBC) data may be encoded in the symbologies
Aztec Code, Codablock-F, Code 128, Code 39, Data Matrix, MicroPDF417, Aztec Code, Codablock F, Code 128, Code 39, Data Matrix, MicroPDF417,
PDF417 and QR Code. Within this mode, the leading <code>'+'</code> and PDF417 and QR Code. Within this mode, the leading <code>'+'</code> and
the check character are automatically added by Zint, conforming to HIBC the check character are automatically added by Zint, conforming to HIBC
Labeler Identification Code (HIBC LIC). For HIBC Provider Applications Labeler Identification Code (HIBC LIC). For HIBC Provider Applications
@@ -3298,6 +3299,8 @@ hexadecimal values if asked to output to a text file
(<code>"*.txt"</code>) or if given the option (<code>"*.txt"</code>) or if given the option
<code>--filetype=txt</code> or the option <code>--dump</code>. This can <code>--filetype=txt</code> or the option <code>--dump</code>. This can
be used for test and diagnostic purposes.</p> be used for test and diagnostic purposes.</p>
<p>Also theres the <code>--verbose</code> option which will output
debug information to <code>stdout</code>.</p>
<p>Additional options are available which are specific to certain <p>Additional options are available which are specific to certain
symbologies. These may, for example, control the amount of error symbologies. These may, for example, control the amount of error
correction data or the size of the symbol. These options are discussed correction data or the size of the symbol. These options are discussed
@@ -4411,7 +4414,7 @@ For instance:</p>
<span id="cb87-2"><a href="#cb87-2" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>ZBarcode_BarcodeName<span class="op">(</span>BARCODE_PDF417<span class="op">,</span> name<span class="op">)</span> <span class="op">==</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span> <span id="cb87-2"><a href="#cb87-2" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>ZBarcode_BarcodeName<span class="op">(</span>BARCODE_PDF417<span class="op">,</span> name<span class="op">)</span> <span class="op">==</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb87-3"><a href="#cb87-3" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span> name<span class="op">);</span></span> <span id="cb87-3"><a href="#cb87-3" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span> name<span class="op">);</span></span>
<span id="cb87-4"><a href="#cb87-4" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> <span id="cb87-4"><a href="#cb87-4" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>will print <code>BARCODE_PDF417</code>.</p> <p>will print BARCODE_PDF417.</p>
<h2 id="checking-symbology-capabilities">5.15 Checking Symbology <h2 id="checking-symbology-capabilities">5.15 Checking Symbology
Capabilities</h2> Capabilities</h2>
<p>It can be useful for frontend programs to know the capabilities of a <p>It can be useful for frontend programs to know the capabilities of a
@@ -4607,6 +4610,11 @@ available, else zero.</p>
<div class="sourceCode" id="cb93"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb93-1"><a href="#cb93-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Version<span class="op">(</span><span class="dt">void</span><span class="op">);</span></span></code></pre></div> <div class="sourceCode" id="cb93"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb93-1"><a href="#cb93-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Version<span class="op">(</span><span class="dt">void</span><span class="op">);</span></span></code></pre></div>
<p>The version parts are separated by hundreds. For instance, version <p>The version parts are separated by hundreds. For instance, version
<code>"2.9.1"</code> is returned as <code>"20901"</code>.</p> <code>"2.9.1"</code> is returned as <code>"20901"</code>.</p>
<h2 id="debug-info">5.19 Debug Info</h2>
<p>Debugging information can be output to <code>stdout</code> by setting
the <code>debug</code> member to <code>ZINT_DEBUG_PRINT</code>
(<code>1</code>). Other values are used internally by the test suite and
shouldnt be set.</p>
<h1 id="types-of-symbology">6. Types of Symbology</h1> <h1 id="types-of-symbology">6. Types of Symbology</h1>
<h2 id="one-dimensional-symbols">6.1 One-Dimensional Symbols</h2> <h2 id="one-dimensional-symbols">6.1 One-Dimensional Symbols</h2>
<p>One-dimensional or linear symbols are what most people associate with <p>One-dimensional or linear symbols are what most people associate with
@@ -5581,7 +5589,7 @@ alt="zint --notext --bind --separator=2 -d &quot;This&quot; -d &quot;That&quot;"
<p>A more sophisticated method is to use some type of line indexing <p>A more sophisticated method is to use some type of line indexing
which indicates to the barcode reader which order the stacked symbols which indicates to the barcode reader which order the stacked symbols
should be read in. This is demonstrated by the symbologies below.</p> should be read in. This is demonstrated by the symbologies below.</p>
<h3 id="codablock-f">6.2.2 Codablock-F</h3> <h3 id="codablock-f">6.2.2 Codablock F</h3>
<p>This is a stacked symbology based on Code 128 which can encode <p>This is a stacked symbology based on Code 128 which can encode
Latin-1 data up to a maximum length of 2726 symbol characters, meaning Latin-1 data up to a maximum length of 2726 symbol characters, meaning
for instance up to 2726 all ASCII characters, or 5452 all numeric, or up for instance up to 2726 all ASCII characters, or 5452 all numeric, or up
@@ -5592,12 +5600,12 @@ alt="zint -b CODABLOCKF -d &quot;CODABLOCK F Symbology&quot; --rows=3" />
<figcaption><span class="figure-label">Figure 84:</span> <figcaption><span class="figure-label">Figure 84:</span>
<code>zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3</code></figcaption> <code>zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3</code></figcaption>
</figure> </figure>
<p>The width of the Codablock-F symbol can be set using the <p>The width of the Codablock F symbol can be set using the
<code>--cols</code> option (API <code>option_2</code>), to a value <code>--cols</code> option (API <code>option_2</code>), to a value
between 9 and 67. The height (number of rows) can be set using the between 9 and 67. The height (number of rows) can be set using the
<code>--rows</code> option (API <code>option_1</code>), with a maximum <code>--rows</code> option (API <code>option_1</code>), with a maximum
of 44. Zint does not currently support encoding of GS1 data in of 44. Zint does not currently support encoding of GS1 data in Codablock
Codablock-F symbols.</p> F symbols.</p>
<p>A separate symbology ID (<code>BARCODE_HIBC_BLOCKF</code>) can be <p>A separate symbology ID (<code>BARCODE_HIBC_BLOCKF</code>) can be
used to encode Health Industry Barcode (HIBC) data which adds a leading used to encode Health Industry Barcode (HIBC) data which adds a leading
<code>'+'</code> character and a modulo-49 check digit to the encoded <code>'+'</code> character and a modulo-49 check digit to the encoded
@@ -8543,7 +8551,7 @@ Silicon Wafers (BC412) (1996)</li>
Code</li> Code</li>
<li>BS EN 798:1996 Bar coding - Symbology specifications - <li>BS EN 798:1996 Bar coding - Symbology specifications -
Codabar</li> Codabar</li>
<li>AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock-F <li>AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock F
(1995)</li> (1995)</li>
<li>ISO/IEC 15417:2007 Information technology - Automatic identification <li>ISO/IEC 15417:2007 Information technology - Automatic identification
and data capture techniques - Code 128 bar code symbology and data capture techniques - Code 128 bar code symbology
@@ -9217,7 +9225,7 @@ the <code>--border</code> option.</p>
<dt><code>--cols=INTEGER</code></dt> <dt><code>--cols=INTEGER</code></dt>
<dd> <dd>
<p>Set the number of data columns in the symbol to <em>INTEGER</em>. <p>Set the number of data columns in the symbol to <em>INTEGER</em>.
Affects Codablock-F, DotCode, GS1 DataBar Expanded Stacked Affects Codablock F, DotCode, GS1 DataBar Expanded Stacked
(DBAR_EXPSTK), MicroPDF417 and PDF417 symbols.</p> (DBAR_EXPSTK), MicroPDF417 and PDF417 symbols.</p>
</dd> </dd>
<dt><code>--compliantheight</code></dt> <dt><code>--compliantheight</code></dt>
@@ -9413,7 +9421,7 @@ floating-point.</p>
</dd> </dd>
<dt><code>--heightperrow</code></dt> <dt><code>--heightperrow</code></dt>
<dd> <dd>
<p>Treat height as per-row. Affects Codablock-F, Code 16K, Code 49, GS1 <p>Treat height as per-row. Affects Codablock F, Code 16K, Code 49, GS1
DataBar Expanded Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417.</p> DataBar Expanded Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417.</p>
</dd> </dd>
<dt><code>-i</code>, <code>--input=FILE</code></dt> <dt><code>-i</code>, <code>--input=FILE</code></dt>
@@ -9502,7 +9510,7 @@ can be 0, 90, 270 or 360.</p>
</dd> </dd>
<dt><code>--rows=INTEGER</code></dt> <dt><code>--rows=INTEGER</code></dt>
<dd> <dd>
<p>Set the number of rows for Codablock-F or PDF417 to <em>INTEGER</em>. <p>Set the number of rows for Codablock F or PDF417 to <em>INTEGER</em>.
It will also set the minimum number of rows for Code 16K or Code 49, and It will also set the minimum number of rows for Code 16K or Code 49, and
the maximum number of rows for GS1 DataBar Expanded Stacked the maximum number of rows for GS1 DataBar Expanded Stacked
(DBAR_EXPSTK).</p> (DBAR_EXPSTK).</p>
@@ -9594,6 +9602,10 @@ names can be used with <code>-b</code> | <code>--barcode</code>.</p>
<em>NUMBER</em> is in X-dimensions, and may be floating-point. Maximum <em>NUMBER</em> is in X-dimensions, and may be floating-point. Maximum
is 10 and minimum is -5. The default is 1.</p> is 10 and minimum is -5. The default is 1.</p>
</dd> </dd>
<dt><code>--verbose</code></dt>
<dd>
<p>Output debug information to stdout.</p>
</dd>
<dt><code>--vers=INTEGER</code></dt> <dt><code>--vers=INTEGER</code></dt>
<dd> <dd>
<p>Set the symbol version (size, check digits, other options) to <p>Set the symbol version (size, check digits, other options) to
@@ -9967,10 +9979,10 @@ role="doc-backlink">↩︎</a></p></li>
default for DPD - see <a href="#dpd-code">6.1.10.7 DPD Code</a>.<a default for DPD - see <a href="#dpd-code">6.1.10.7 DPD Code</a>.<a
href="#fnref15" class="footnote-back" role="doc-backlink">↩︎</a></p></li> href="#fnref15" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn16"><p>The <code>BARCODE_BIND</code> flag is always set for <li id="fn16"><p>The <code>BARCODE_BIND</code> flag is always set for
Codablock-F, Code 16K and Code 49. Special considerations apply to Codablock F, Code 16K and Code 49. Special considerations apply to
ITF-14 - see <a href="#itf-14">6.1.2.6 ITF-14</a>.<a href="#fnref16" ITF-14 - see <a href="#itf-14">6.1.2.6 ITF-14</a>.<a href="#fnref16"
class="footnote-back" role="doc-backlink">↩︎</a></p></li> class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn17"><p>Codablock-F, Code 16K, Code 49, EAN-13, EAN-8, EAN/UPC <li id="fn17"><p>Codablock F, Code 16K, Code 49, EAN-13, EAN-8, EAN/UPC
add-ons, ISBN, ITF-14, UPC-A and UPC-E have compliant quiet zones added add-ons, ISBN, ITF-14, UPC-A and UPC-E have compliant quiet zones added
by default.<a href="#fnref17" class="footnote-back" by default.<a href="#fnref17" class="footnote-back"
role="doc-backlink">↩︎</a></p></li> role="doc-backlink">↩︎</a></p></li>
+25 -14
View File
@@ -2,6 +2,8 @@
% Version 2.16.0.9 % Version 2.16.0.9
% March 2026 % March 2026
[//]: # ( vim: set ts=4 sw=4 et : )
# 1. Introduction # 1. Introduction
The Zint project aims to provide a complete cross-platform open source barcode The Zint project aims to provide a complete cross-platform open source barcode
@@ -781,7 +783,7 @@ Value
73 `BARCODE_VIN` Vehicle Identification Number 73 `BARCODE_VIN` Vehicle Identification Number
74 `BARCODE_CODABLOCKF` Codablock-F 74 `BARCODE_CODABLOCKF` Codablock F
75 `BARCODE_NVE18` NVE-18 (SSCC-18) 75 `BARCODE_NVE18` NVE-18 (SSCC-18)
@@ -829,7 +831,7 @@ Value
108 `BARCODE_HIBC_MICPDF` HIBC MicroPDF417 108 `BARCODE_HIBC_MICPDF` HIBC MicroPDF417
110 `BARCODE_HIBC_BLOCKF` HIBC Codablock-F 110 `BARCODE_HIBC_BLOCKF` HIBC Codablock F
112 `BARCODE_HIBC_AZTEC` HIBC Aztec Code 112 `BARCODE_HIBC_AZTEC` HIBC Aztec Code
@@ -934,7 +936,7 @@ Warning 247: Height not compliant with standards
``` ```
Another switch is `--heightperrow`, which can be useful for symbologies that Another switch is `--heightperrow`, which can be useful for symbologies that
have a variable number of linear rows, namely Codablock-F, Code 16K, Code 49, have a variable number of linear rows, namely Codablock F, Code 16K, Code 49,
GS1 DataBar Expanded Stacked, MicroPDF417 and PDF417, as it changes the GS1 DataBar Expanded Stacked, MicroPDF417 and PDF417, as it changes the
treatment of the height value from overall height to per-row height, allowing treatment of the height value from overall height to per-row height, allowing
you to specify a consistent height for each linear row without having to know you to specify a consistent height for each linear row without having to know
@@ -982,7 +984,7 @@ A `--quietzones` option is also available which adds quiet zones compliant with
the symbology's specification. This is in addition to any whitespace specified the symbology's specification. This is in addition to any whitespace specified
with the `--whitesp` or `--vwhitesp` switches. with the `--whitesp` or `--vwhitesp` switches.
Note that Codablock-F, Code 16K, Code 49, ITF-14, EAN-13, EAN-8, EAN/UPC Note that Codablock F, Code 16K, Code 49, ITF-14, EAN-13, EAN-8, EAN/UPC
add-ons, ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This add-ons, ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This
can be disabled with the option `--noquietzones`. can be disabled with the option `--noquietzones`.
@@ -1016,7 +1018,7 @@ whitespace.
![`zint -b QRCODE --border=1 --box -d "This Text" ![`zint -b QRCODE --border=1 --box -d "This Text"
--quietzones`](images/qrcode_box.svg){.i2d} --quietzones`](images/qrcode_box.svg){.i2d}
Codablock-F, Code 16K and Code 49 always have boundary bars, and default to Codablock F, Code 16K and Code 49 always have boundary bars, and default to
particular horizontal whitespace values. Special considerations apply to ITF-14 particular horizontal whitespace values. Special considerations apply to ITF-14
and DPD - see [6.1.2.6 ITF-14] and [6.1.10.7 DPD Code] for those symbologies. and DPD - see [6.1.2.6 ITF-14] and [6.1.10.7 DPD Code] for those symbologies.
@@ -1258,7 +1260,7 @@ Latin-2 (ISO/IEC 8859-2 plus ASCII).
Symbology Default character sets Alternate if input not Latin-1 Symbology Default character sets Alternate if input not Latin-1
------------- ------------------------ ------------------------------ ------------- ------------------------ ------------------------------
Aztec Code Latin-1 None Aztec Code Latin-1 None
Codablock-F Latin-1 None Codablock F Latin-1 None
Code 128 Latin-1 None Code 128 Latin-1 None
Code 16K Latin-1 None Code 16K Latin-1 None
Code One Latin-1 None Code One Latin-1 None
@@ -1290,7 +1292,7 @@ GS1 data can be encoded in a number of symbologies - see [4.11.3 GS1 Data Entry
and Options]. and Options].
Health Industry Barcode (HIBC) data may be encoded in the symbologies Aztec Health Industry Barcode (HIBC) data may be encoded in the symbologies Aztec
Code, Codablock-F, Code 128, Code 39, Data Matrix, MicroPDF417, PDF417 and QR Code, Codablock F, Code 128, Code 39, Data Matrix, MicroPDF417, PDF417 and QR
Code. Within this mode, the leading `'+'` and the check character are Code. Within this mode, the leading `'+'` and the check character are
automatically added by Zint, conforming to HIBC Labeler Identification Code automatically added by Zint, conforming to HIBC Labeler Identification Code
(HIBC LIC). For HIBC Provider Applications Standard (HIBC PAS), preface the data (HIBC LIC). For HIBC Provider Applications Standard (HIBC PAS), preface the data
@@ -1769,6 +1771,9 @@ values if asked to output to a text file (`"*.txt"`) or if given the option
`--filetype=txt` or the option `--dump`. This can be used for test and `--filetype=txt` or the option `--dump`. This can be used for test and
diagnostic purposes. diagnostic purposes.
Also there's the `--verbose` option which will output debug information to
`stdout`.
Additional options are available which are specific to certain symbologies. Additional options are available which are specific to certain symbologies.
These may, for example, control the amount of error correction data or the size These may, for example, control the amount of error correction data or the size
of the symbol. These options are discussed in section [6. Types of Symbology] of of the symbol. These options are discussed in section [6. Types of Symbology] of
@@ -2479,10 +2484,10 @@ Table: API `output_options` Values {#tbl:api_output_options}
[^15]: The `BARCODE_BIND_TOP` flag is set by default for DPD - see [6.1.10.7 DPD [^15]: The `BARCODE_BIND_TOP` flag is set by default for DPD - see [6.1.10.7 DPD
Code]. Code].
[^16]: The `BARCODE_BIND` flag is always set for Codablock-F, Code 16K and Code [^16]: The `BARCODE_BIND` flag is always set for Codablock F, Code 16K and Code
49. Special considerations apply to ITF-14 - see [6.1.2.6 ITF-14]. 49. Special considerations apply to ITF-14 - see [6.1.2.6 ITF-14].
[^17]: Codablock-F, Code 16K, Code 49, EAN-13, EAN-8, EAN/UPC add-ons, ISBN, [^17]: Codablock F, Code 16K, Code 49, EAN-13, EAN-8, EAN/UPC add-ons, ISBN,
ITF-14, UPC-A and UPC-E have compliant quiet zones added by default. ITF-14, UPC-A and UPC-E have compliant quiet zones added by default.
## 5.11 Setting the Input Mode ## 5.11 Setting the Input Mode
@@ -2719,7 +2724,7 @@ if (ZBarcode_BarcodeName(BARCODE_PDF417, name) == 0) {
} }
``` ```
will print `BARCODE_PDF417`. will print "BARCODE_PDF417".
## 5.15 Checking Symbology Capabilities ## 5.15 Checking Symbology Capabilities
@@ -2896,6 +2901,12 @@ int ZBarcode_Version(void);
The version parts are separated by hundreds. For instance, version `"2.9.1"` is The version parts are separated by hundreds. For instance, version `"2.9.1"` is
returned as `"20901"`. returned as `"20901"`.
## 5.19 Debug Info
Debugging information can be output to `stdout` by setting the `debug` member to
`ZINT_DEBUG_PRINT` (`1`). Other values are used internally by the test suite and
shouldn't be set.
# 6. Types of Symbology # 6. Types of Symbology
@@ -3733,7 +3744,7 @@ A more sophisticated method is to use some type of line indexing which indicates
to the barcode reader which order the stacked symbols should be read in. This is to the barcode reader which order the stacked symbols should be read in. This is
demonstrated by the symbologies below. demonstrated by the symbologies below.
### 6.2.2 Codablock-F ### 6.2.2 Codablock F
This is a stacked symbology based on Code 128 which can encode Latin-1 data up This is a stacked symbology based on Code 128 which can encode Latin-1 data up
to a maximum length of 2726 symbol characters, meaning for instance up to 2726 to a maximum length of 2726 symbol characters, meaning for instance up to 2726
@@ -3743,10 +3754,10 @@ all ASCII characters, or 5452 all numeric, or up to 1363 all extended ASCII
![`zint -b CODABLOCKF -d "CODABLOCK F Symbology" ![`zint -b CODABLOCKF -d "CODABLOCK F Symbology"
--rows=3`](images/codablockf.svg){.lin} --rows=3`](images/codablockf.svg){.lin}
The width of the Codablock-F symbol can be set using the `--cols` option (API The width of the Codablock F symbol can be set using the `--cols` option (API
`option_2`), to a value between 9 and 67. The height (number of rows) can be set `option_2`), to a value between 9 and 67. The height (number of rows) can be set
using the `--rows` option (API `option_1`), with a maximum of 44. Zint does not using the `--rows` option (API `option_1`), with a maximum of 44. Zint does not
currently support encoding of GS1 data in Codablock-F symbols. currently support encoding of GS1 data in Codablock F symbols.
A separate symbology ID (`BARCODE_HIBC_BLOCKF`) can be used to encode Health A separate symbology ID (`BARCODE_HIBC_BLOCKF`) can be used to encode Health
Industry Barcode (HIBC) data which adds a leading `'+'` character and a Industry Barcode (HIBC) data which adds a leading `'+'` character and a
@@ -5200,7 +5211,7 @@ international standards:
(BC412) (1996) (BC412) (1996)
- ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel Code - ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel Code
- BS EN 798:1996 Bar coding - Symbology specifications - 'Codabar' - BS EN 798:1996 Bar coding - Symbology specifications - 'Codabar'
- AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock-F (1995) - AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock F (1995)
- ISO/IEC 15417:2007 Information technology - Automatic identification and data - ISO/IEC 15417:2007 Information technology - Automatic identification and data
capture techniques - Code 128 bar code symbology specification capture techniques - Code 128 bar code symbology specification
- BS EN 12323:2005 AIDC technologies - Symbology specifications - Code 16K - BS EN 12323:2005 AIDC technologies - Symbology specifications - Code 16K
+33 -20
View File
@@ -78,6 +78,7 @@ March 2026
- 5.16 Feedback - 5.16 Feedback
- 5.17 UTF-8 to ECI convenience functions - 5.17 UTF-8 to ECI convenience functions
- 5.18 Zint Version - 5.18 Zint Version
- 5.19 Debug Info
- 6. Types of Symbology - 6. Types of Symbology
- 6.1 One-Dimensional Symbols - 6.1 One-Dimensional Symbols
- 6.1.1 Code 11 - 6.1.1 Code 11
@@ -133,7 +134,7 @@ March 2026
- 6.1.14 BC412 (SEMI T1-95) - 6.1.14 BC412 (SEMI T1-95)
- 6.2 Stacked Symbologies - 6.2 Stacked Symbologies
- 6.2.1 Basic Symbol Stacking - 6.2.1 Basic Symbol Stacking
- 6.2.2 Codablock-F - 6.2.2 Codablock F
- 6.2.3 Code 16K (EN 12323) - 6.2.3 Code 16K (EN 12323)
- 6.2.4 PDF417 (ISO 15438) - 6.2.4 PDF417 (ISO 15438)
- 6.2.5 Compact PDF417 (ISO 15438) - 6.2.5 Compact PDF417 (ISO 15438)
@@ -922,7 +923,7 @@ underscores are optional.
73 BARCODE_VIN Vehicle Identification Number 73 BARCODE_VIN Vehicle Identification Number
74 BARCODE_CODABLOCKF Codablock-F 74 BARCODE_CODABLOCKF Codablock F
75 BARCODE_NVE18 NVE-18 (SSCC-18) 75 BARCODE_NVE18 NVE-18 (SSCC-18)
@@ -970,7 +971,7 @@ underscores are optional.
108 BARCODE_HIBC_MICPDF HIBC MicroPDF417 108 BARCODE_HIBC_MICPDF HIBC MicroPDF417
110 BARCODE_HIBC_BLOCKF HIBC Codablock-F 110 BARCODE_HIBC_BLOCKF HIBC Codablock F
112 BARCODE_HIBC_AZTEC HIBC Aztec Code 112 BARCODE_HIBC_AZTEC HIBC Aztec Code
@@ -1063,7 +1064,7 @@ given:
Warning 247: Height not compliant with standards Warning 247: Height not compliant with standards
Another switch is --heightperrow, which can be useful for symbologies that have Another switch is --heightperrow, which can be useful for symbologies that have
a variable number of linear rows, namely Codablock-F, Code 16K, Code 49, GS1 a variable number of linear rows, namely Codablock F, Code 16K, Code 49, GS1
DataBar Expanded Stacked, MicroPDF417 and PDF417, as it changes the treatment of DataBar Expanded Stacked, MicroPDF417 and PDF417, as it changes the treatment of
the height value from overall height to per-row height, allowing you to specify the height value from overall height to per-row height, allowing you to specify
a consistent height for each linear row without having to know how many there a consistent height for each linear row without having to know how many there
@@ -1102,7 +1103,7 @@ A --quietzones option is also available which adds quiet zones compliant with
the symbologys specification. This is in addition to any whitespace specified the symbologys specification. This is in addition to any whitespace specified
with the --whitesp or --vwhitesp switches. with the --whitesp or --vwhitesp switches.
Note that Codablock-F, Code 16K, Code 49, ITF-14, EAN-13, EAN-8, EAN/UPC Note that Codablock F, Code 16K, Code 49, ITF-14, EAN-13, EAN-8, EAN/UPC
add-ons, ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This add-ons, ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This
can be disabled with the option --noquietzones. can be disabled with the option --noquietzones.
@@ -1133,7 +1134,7 @@ whitespace.
[zint -b QRCODE --border=1 --box -d "This Text" --quietzones] [zint -b QRCODE --border=1 --box -d "This Text" --quietzones]
Codablock-F, Code 16K and Code 49 always have boundary bars, and default to Codablock F, Code 16K and Code 49 always have boundary bars, and default to
particular horizontal whitespace values. Special considerations apply to ITF-14 particular horizontal whitespace values. Special considerations apply to ITF-14
and DPD - see 6.1.2.6 ITF-14 and 6.1.10.7 DPD Code for those symbologies. and DPD - see 6.1.2.6 ITF-14 and 6.1.10.7 DPD Code for those symbologies.
@@ -1342,7 +1343,7 @@ Latin-2 (ISO/IEC 8859-2 plus ASCII).
Symbology Default character sets Alternate if input not Latin-1 Symbology Default character sets Alternate if input not Latin-1
--------------- -------------------------- -------------------------------- --------------- -------------------------- --------------------------------
Aztec Code Latin-1 None Aztec Code Latin-1 None
Codablock-F Latin-1 None Codablock F Latin-1 None
Code 128 Latin-1 None Code 128 Latin-1 None
Code 16K Latin-1 None Code 16K Latin-1 None
Code One Latin-1 None Code One Latin-1 None
@@ -1371,7 +1372,7 @@ GS1 data can be encoded in a number of symbologies - see 4.11.3 GS1 Data Entry
and Options. and Options.
Health Industry Barcode (HIBC) data may be encoded in the symbologies Aztec Health Industry Barcode (HIBC) data may be encoded in the symbologies Aztec
Code, Codablock-F, Code 128, Code 39, Data Matrix, MicroPDF417, PDF417 and QR Code, Codablock F, Code 128, Code 39, Data Matrix, MicroPDF417, PDF417 and QR
Code. Within this mode, the leading '+' and the check character are Code. Within this mode, the leading '+' and the check character are
automatically added by Zint, conforming to HIBC Labeler Identification Code automatically added by Zint, conforming to HIBC Labeler Identification Code
(HIBC LIC). For HIBC Provider Applications Standard (HIBC PAS), preface the data (HIBC LIC). For HIBC Provider Applications Standard (HIBC PAS), preface the data
@@ -1791,6 +1792,8 @@ values if asked to output to a text file ("*.txt") or if given the option
--filetype=txt or the option --dump. This can be used for test and diagnostic --filetype=txt or the option --dump. This can be used for test and diagnostic
purposes. purposes.
Also theres the --verbose option which will output debug information to stdout.
Additional options are available which are specific to certain symbologies. Additional options are available which are specific to certain symbologies.
These may, for example, control the amount of error correction data or the size These may, for example, control the amount of error correction data or the size
of the symbol. These options are discussed in section 6. Types of Symbology of of the symbol. These options are discussed in section 6. Types of Symbology of
@@ -2653,7 +2656,7 @@ success. For instance:
printf("%s\n", name); printf("%s\n", name);
} }
will print BARCODE_PDF417. will print BARCODE_PDF417.
5.15 Checking Symbology Capabilities 5.15 Checking Symbology Capabilities
@@ -2802,6 +2805,12 @@ Lastly, the version of the Zint library linked to is returned by:
The version parts are separated by hundreds. For instance, version "2.9.1" is The version parts are separated by hundreds. For instance, version "2.9.1" is
returned as "20901". returned as "20901".
5.19 Debug Info
Debugging information can be output to stdout by setting the debug member to
ZINT_DEBUG_PRINT (1). Other values are used internally by the test suite and
shouldnt be set.
6. Types of Symbology 6. Types of Symbology
6.1 One-Dimensional Symbols 6.1 One-Dimensional Symbols
@@ -3566,7 +3575,7 @@ A more sophisticated method is to use some type of line indexing which indicates
to the barcode reader which order the stacked symbols should be read in. This is to the barcode reader which order the stacked symbols should be read in. This is
demonstrated by the symbologies below. demonstrated by the symbologies below.
6.2.2 Codablock-F 6.2.2 Codablock F
This is a stacked symbology based on Code 128 which can encode Latin-1 data up This is a stacked symbology based on Code 128 which can encode Latin-1 data up
to a maximum length of 2726 symbol characters, meaning for instance up to 2726 to a maximum length of 2726 symbol characters, meaning for instance up to 2726
@@ -3575,10 +3584,10 @@ all ASCII characters, or 5452 all numeric, or up to 1363 all extended ASCII
[zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3] [zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3]
The width of the Codablock-F symbol can be set using the --cols option (API The width of the Codablock F symbol can be set using the --cols option (API
option_2), to a value between 9 and 67. The height (number of rows) can be set option_2), to a value between 9 and 67. The height (number of rows) can be set
using the --rows option (API option_1), with a maximum of 44. Zint does not using the --rows option (API option_1), with a maximum of 44. Zint does not
currently support encoding of GS1 data in Codablock-F symbols. currently support encoding of GS1 data in Codablock F symbols.
A separate symbology ID (BARCODE_HIBC_BLOCKF) can be used to encode Health A separate symbology ID (BARCODE_HIBC_BLOCKF) can be used to encode Health
Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49 Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49
@@ -4976,7 +4985,7 @@ international standards:
(BC412) (1996) (BC412) (1996)
- ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel Code - ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel Code
- BS EN 798:1996 Bar coding - Symbology specifications - Codabar - BS EN 798:1996 Bar coding - Symbology specifications - Codabar
- AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock-F (1995) - AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock F (1995)
- ISO/IEC 15417:2007 Information technology - Automatic identification and data - ISO/IEC 15417:2007 Information technology - Automatic identification and data
capture techniques - Code 128 bar code symbology specification capture techniques - Code 128 bar code symbology specification
- BS EN 12323:2005 AIDC technologies - Symbology specifications - Code 16K - BS EN 12323:2005 AIDC technologies - Symbology specifications - Code 16K
@@ -5291,9 +5300,9 @@ OPTIONS
--cols=INTEGER --cols=INTEGER
Set the number of data columns in the symbol to INTEGER. Affects Set the number of data columns in the symbol to INTEGER. Affects Codablock
Codablock-F, DotCode, GS1 DataBar Expanded Stacked (DBAR_EXPSTK), F, DotCode, GS1 DataBar Expanded Stacked (DBAR_EXPSTK), MicroPDF417 and
MicroPDF417 and PDF417 symbols. PDF417 symbols.
--compliantheight --compliantheight
@@ -5466,7 +5475,7 @@ OPTIONS
--heightperrow --heightperrow
Treat height as per-row. Affects Codablock-F, Code 16K, Code 49, GS1 DataBar Treat height as per-row. Affects Codablock F, Code 16K, Code 49, GS1 DataBar
Expanded Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417. Expanded Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417.
-i, --input=FILE -i, --input=FILE
@@ -5554,7 +5563,7 @@ OPTIONS
--rows=INTEGER --rows=INTEGER
Set the number of rows for Codablock-F or PDF417 to INTEGER. It will also Set the number of rows for Codablock F or PDF417 to INTEGER. It will also
set the minimum number of rows for Code 16K or Code 49, and the maximum set the minimum number of rows for Code 16K or Code 49, and the maximum
number of rows for GS1 DataBar Expanded Stacked (DBAR_EXPSTK). number of rows for GS1 DataBar Expanded Stacked (DBAR_EXPSTK).
@@ -5643,6 +5652,10 @@ OPTIONS
is in X-dimensions, and may be floating-point. Maximum is 10 and minimum is is in X-dimensions, and may be floating-point. Maximum is 10 and minimum is
-5. The default is 1. -5. The default is 1.
--verbose
Output debug information to stdout.
--vers=INTEGER --vers=INTEGER
Set the symbol version (size, check digits, other options) to INTEGER. The Set the symbol version (size, check digits, other options) to INTEGER. The
@@ -5981,10 +5994,10 @@ height).
[15] The BARCODE_BIND_TOP flag is set by default for DPD - see 6.1.10.7 DPD [15] The BARCODE_BIND_TOP flag is set by default for DPD - see 6.1.10.7 DPD
Code. Code.
[16] The BARCODE_BIND flag is always set for Codablock-F, Code 16K and Code 49. [16] The BARCODE_BIND flag is always set for Codablock F, Code 16K and Code 49.
Special considerations apply to ITF-14 - see 6.1.2.6 ITF-14. Special considerations apply to ITF-14 - see 6.1.2.6 ITF-14.
[17] Codablock-F, Code 16K, Code 49, EAN-13, EAN-8, EAN/UPC add-ons, ISBN, [17] Codablock F, Code 16K, Code 49, EAN-13, EAN-8, EAN/UPC add-ons, ISBN,
ITF-14, UPC-A and UPC-E have compliant quiet zones added by default. ITF-14, UPC-A and UPC-E have compliant quiet zones added by default.
[18] ZINT_CAP_EANUPC was previously named ZINT_CAP_EXTENDABLE, which is still [18] ZINT_CAP_EANUPC was previously named ZINT_CAP_EXTENDABLE, which is still
+50
View File
@@ -0,0 +1,50 @@
.\" Automatically generated by Pandoc 3.9
.\"
.TH "ZINT\-QT" "1" "March 2026" "Version 2.16.0.9"
.SH NAME
\f[CR]zint\-qt\f[R] \- Zint Barcode Studio, a Qt frontend to the Zint
Barcode Generator
.SH SYNOPSIS
.PP
\f[CR]zint\-qt\f[R] [\f[CR]\-\-verbose\f[R]]
.SH DESCRIPTION
zint\-qt encodes input data in a barcode which can then be saved to an
image file or to the clipboard.
.PP
Input data is UTF\-8, unless the \(lqBinary Mode\(rq checkbox is
checked.
.PP
Output may be in one of these formats: Windows Bitmap (\f[CR]BMP\f[R]),
Enhanced Metafile Format (\f[CR]EMF\f[R]), Encapsulated PostScript
(\f[CR]EPS\f[R]), Graphics Interchange Format (\f[CR]GIF\f[R]), ZSoft
Paintbrush (\f[CR]PCX\f[R]), Portable Network Format (\f[CR]PNG\f[R]),
Scalable Vector Graphic (\f[CR]SVG\f[R]), or Tagged Image File Format
(\f[CR]TIF\f[R]).
.SH OPTIONS
.TP
\f[CR]\-\-verbose\f[R]
Output debug information to stdout.
.SH EXIT STATUS
\f[CR]0\f[R]
.SH BUGS
Please send bug reports to https://sourceforge.net/p/zint/tickets/.
.SH SEE ALSO
Documentation for \f[CR]zint\-qt\f[R] (and the API \f[CR]libzint\f[R]
and the CLI \f[CR]zint\f[R]) is available from
.IP
.EX
https://zint.org.uk/manual/
.EE
.PP
and at
.IP
.EX
https://sourceforge.net/p/zint/docs/manual.txt
.EE
.SH COPYRIGHT
Copyright © 2026 Robin Stuart.
Released under GNU GPL 3.0 or later.
.SH AUTHOR
Robin Stuart \c
.MT robin@zint.org.uk
.ME \c
+55
View File
@@ -0,0 +1,55 @@
% ZINT-QT(1) Version 2.16.0.9
%
% March 2026
[//]: # ( vim: set ts=4 sw=4 et : )
# NAME
`zint-qt` - Zint Barcode Studio, a Qt frontend to the Zint Barcode Generator
# SYNOPSIS
| `zint-qt` [`--verbose`]
# DESCRIPTION
zint-qt encodes input data in a barcode which can then be saved to an image file or to the clipboard.
Input data is UTF-8, unless the "Binary Mode" checkbox is checked.
Output may be in one of these formats: Windows Bitmap (`BMP`), Enhanced Metafile Format (`EMF`), Encapsulated
PostScript (`EPS`), Graphics Interchange Format (`GIF`), ZSoft Paintbrush (`PCX`), Portable Network Format (`PNG`),
Scalable Vector Graphic (`SVG`), or Tagged Image File Format (`TIF`).
# OPTIONS
`--verbose`
: Output debug information to stdout.
# EXIT STATUS
`0`
# BUGS
Please send bug reports to https://sourceforge.net/p/zint/tickets/.
# SEE ALSO
Documentation for `zint-qt` (and the API `libzint` and the CLI `zint`) is available from
https://zint.org.uk/manual/
and at
https://sourceforge.net/p/zint/docs/manual.txt
# COPYRIGHT
Copyright © 2026 Robin Stuart. Released under GNU GPL 3.0 or later.
# AUTHOR
Robin Stuart <robin@zint.org.uk>
+6 -3
View File
@@ -103,7 +103,7 @@ Use the CMYK colour space when outputting to Encapsulated PostScript
.TP .TP
\f[CR]\-\-cols=INTEGER\f[R] \f[CR]\-\-cols=INTEGER\f[R]
Set the number of data columns in the symbol to \f[I]INTEGER\f[R]. Set the number of data columns in the symbol to \f[I]INTEGER\f[R].
Affects Codablock\-F, DotCode, GS1 DataBar Expanded Stacked Affects Codablock F, DotCode, GS1 DataBar Expanded Stacked
(DBAR_EXPSTK), MicroPDF417 and PDF417 symbols. (DBAR_EXPSTK), MicroPDF417 and PDF417 symbols.
.TP .TP
\f[CR]\-\-compliantheight\f[R] \f[CR]\-\-compliantheight\f[R]
@@ -283,7 +283,7 @@ Set the height of the symbol in X\-dimensions.
.TP .TP
\f[CR]\-\-heightperrow\f[R] \f[CR]\-\-heightperrow\f[R]
Treat height as per\-row. Treat height as per\-row.
Affects Codablock\-F, Code 16K, Code 49, GS1 DataBar Expanded Stacked Affects Codablock F, Code 16K, Code 49, GS1 DataBar Expanded Stacked
(DBAR_EXPSTK), MicroPDF417 and PDF417. (DBAR_EXPSTK), MicroPDF417 and PDF417.
.TP .TP
\f[CR]\-i\f[R], \f[CR]\-\-input=FILE\f[R] \f[CR]\-i\f[R], \f[CR]\-\-input=FILE\f[R]
@@ -374,7 +374,7 @@ Rotate the symbol by \f[I]INTEGER\f[R] degrees, where \f[I]INTEGER\f[R]
can be 0, 90, 270 or 360. can be 0, 90, 270 or 360.
.TP .TP
\f[CR]\-\-rows=INTEGER\f[R] \f[CR]\-\-rows=INTEGER\f[R]
Set the number of rows for Codablock\-F or PDF417 to \f[I]INTEGER\f[R]. Set the number of rows for Codablock F or PDF417 to \f[I]INTEGER\f[R].
It will also set the minimum number of rows for Code 16K or Code 49, and It will also set the minimum number of rows for Code 16K or Code 49, and
the maximum number of rows for GS1 DataBar Expanded Stacked the maximum number of rows for GS1 DataBar Expanded Stacked
(DBAR_EXPSTK). (DBAR_EXPSTK).
@@ -477,6 +477,9 @@ Adjust the gap between the barcode and the Human Readable Text (HRT).
Maximum is 10 and minimum is \-5. Maximum is 10 and minimum is \-5.
The default is 1. The default is 1.
.TP .TP
\f[CR]\-\-verbose\f[R]
Output debug information to stdout.
.TP
\f[CR]\-\-vers=INTEGER\f[R] \f[CR]\-\-vers=INTEGER\f[R]
Set the symbol version (size, check digits, other options) to Set the symbol version (size, check digits, other options) to
\f[I]INTEGER\f[R]. \f[I]INTEGER\f[R].
+9 -3
View File
@@ -2,6 +2,8 @@
% %
% March 2026 % March 2026
[//]: # ( vim: set ts=4 sw=4 et : )
# NAME # NAME
`zint` - encode data as a barcode image `zint` - encode data as a barcode image
@@ -93,7 +95,7 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S
`--cols=INTEGER` `--cols=INTEGER`
: Set the number of data columns in the symbol to *INTEGER*. Affects Codablock-F, DotCode, GS1 DataBar Expanded : Set the number of data columns in the symbol to *INTEGER*. Affects Codablock F, DotCode, GS1 DataBar Expanded
Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417 symbols. Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417 symbols.
`--compliantheight` `--compliantheight`
@@ -250,7 +252,7 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S
`--heightperrow` `--heightperrow`
: Treat height as per-row. Affects Codablock-F, Code 16K, Code 49, GS1 DataBar Expanded Stacked (DBAR_EXPSTK), : Treat height as per-row. Affects Codablock F, Code 16K, Code 49, GS1 DataBar Expanded Stacked (DBAR_EXPSTK),
MicroPDF417 and PDF417. MicroPDF417 and PDF417.
`-i`, `--input=FILE` `-i`, `--input=FILE`
@@ -332,7 +334,7 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S
`--rows=INTEGER` `--rows=INTEGER`
: Set the number of rows for Codablock-F or PDF417 to *INTEGER*. It will also set the minimum number of rows for : Set the number of rows for Codablock F or PDF417 to *INTEGER*. It will also set the minimum number of rows for
Code 16K or Code 49, and the maximum number of rows for GS1 DataBar Expanded Stacked (DBAR_EXPSTK). Code 16K or Code 49, and the maximum number of rows for GS1 DataBar Expanded Stacked (DBAR_EXPSTK).
`--scale=NUMBER` `--scale=NUMBER`
@@ -409,6 +411,10 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S
: Adjust the gap between the barcode and the Human Readable Text (HRT). *NUMBER* is in X-dimensions, and may be : Adjust the gap between the barcode and the Human Readable Text (HRT). *NUMBER* is in X-dimensions, and may be
floating-point. Maximum is 10 and minimum is -5. The default is 1. floating-point. Maximum is 10 and minimum is -5. The default is 1.
`--verbose`
: Output debug information to stdout.
`--vers=INTEGER` `--vers=INTEGER`
: Set the symbol version (size, check digits, other options) to *INTEGER*. The meaning is symbol-specific. : Set the symbol version (size, check digits, other options) to *INTEGER*. The meaning is symbol-specific.
+4 -2
View File
@@ -24,8 +24,10 @@ if(NOT HAVE_GETOPT_LONG_ONLY)
target_link_libraries(${PROJECT_NAME} zint_bundled_getopt) target_link_libraries(${PROJECT_NAME} zint_bundled_getopt)
endif() endif()
get_property(libdir GLOBAL PROPERTY ZINT_LIBDIR) if(APPLE AND NOT CMAKE_INSTALL_RPATH)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${libdir}") get_property(libdir GLOBAL PROPERTY ZINT_LIBDIR)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${libdir}")
endif()
install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR}" RUNTIME) install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR}" RUNTIME)
if(UNIX) if(UNIX)
+9 -7
View File
@@ -106,7 +106,7 @@ static void types(void) {
"28 FLAT Flattermarken 104 HIBC_QR HIBC QR Code\n" "28 FLAT Flattermarken 104 HIBC_QR HIBC QR Code\n"
"29 DBAR_OMN GS1 DataBar Omni 106 HIBC_PDF HIBC PDF417\n" "29 DBAR_OMN GS1 DataBar Omni 106 HIBC_PDF HIBC PDF417\n"
"30 DBAR_LTD GS1 DataBar Limited 108 HIBC_MICPDF HIBC MicroPDF417\n" "30 DBAR_LTD GS1 DataBar Limited 108 HIBC_MICPDF HIBC MicroPDF417\n"
"31 DBAR_EXP GS1 DataBar Expanded 110 HIBC_BLOCKF HIBC Codablock-F\n", stdout); "31 DBAR_EXP GS1 DataBar Expanded 110 HIBC_BLOCKF HIBC Codablock F\n", stdout);
fputs("32 TELEPEN Telepen Alpha 112 HIBC_AZTEC HIBC Aztec Code\n" fputs("32 TELEPEN Telepen Alpha 112 HIBC_AZTEC HIBC Aztec Code\n"
"34 UPCA UPC-A 115 DOTCODE DotCode\n" "34 UPCA UPC-A 115 DOTCODE DotCode\n"
"35 UPCA_CHK UPC-A + Check Digit 116 HANXIN Han Xin Code\n" "35 UPCA_CHK UPC-A + Check Digit 116 HANXIN Han Xin Code\n"
@@ -134,7 +134,7 @@ static void types(void) {
"71 DATAMATRIX Data Matrix 147 DXFILMEDGE DX Film Edge Barcode\n", stdout); "71 DATAMATRIX Data Matrix 147 DXFILMEDGE DX Film Edge Barcode\n", stdout);
fputs("72 EAN14 EAN-14 (GS1-128 based) 148 EAN8_CC Composite EAN-8\n" fputs("72 EAN14 EAN-14 (GS1-128 based) 148 EAN8_CC Composite EAN-8\n"
"73 VIN Vehicle Information No. 149 EAN13_CC Composite EAN-13\n" "73 VIN Vehicle Information No. 149 EAN13_CC Composite EAN-13\n"
"74 CODABLOCKF Codablock-F\n", stdout); "74 CODABLOCKF Codablock F\n", stdout);
} }
/* Output version information */ /* Output version information */
@@ -224,7 +224,7 @@ if (have_gs1syntaxengine) {
" --quietzones Add compliant quiet zones\n" " --quietzones Add compliant quiet zones\n"
" -r, --reverse Reverse colours (white on black)\n" " -r, --reverse Reverse colours (white on black)\n"
" --rotate=INTEGER Rotate symbol by INTEGER (0, 90, 180, 270) degrees\n" " --rotate=INTEGER Rotate symbol by INTEGER (0, 90, 180, 270) degrees\n"
" --rows=INTEGER Set number of rows (Codablock-F/PDF417)\n", stdout); " --rows=INTEGER Set number of rows (Codablock F/PDF417)\n", stdout);
fputs( " --scale=NUMBER Adjust size of X-dimension\n" fputs( " --scale=NUMBER Adjust size of X-dimension\n"
" --scalexdimdp=X[,R] Adjust size to X-dimension X at resolution R\n" " --scalexdimdp=X[,R] Adjust size to X-dimension X at resolution R\n"
" --scmvv=INTEGER Prefix SCM with \"[)>\\R01\\Gvv\" (vv is INTEGER) (MaxiCode)\n" " --scmvv=INTEGER Prefix SCM with \"[)>\\R01\\Gvv\" (vv is INTEGER) (MaxiCode)\n"
@@ -236,11 +236,12 @@ if (have_gs1syntaxengine) {
" --structapp=I,C[,ID] Set Structured Append info (I index, C count)\n" " --structapp=I,C[,ID] Set Structured Append info (I index, C count)\n"
" -t, --types Display table of barcode types\n", stdout); " -t, --types Display table of barcode types\n", stdout);
fputs( " --textgap=NUMBER Adjust gap between barcode and HRT in multiples of X-dim\n" fputs( " --textgap=NUMBER Adjust gap between barcode and HRT in multiples of X-dim\n"
" --verbose Output debug info to stdout\n"
" --vers=INTEGER Set symbol version (size, check digits, other options)\n" " --vers=INTEGER Set symbol version (size, check digits, other options)\n"
" -v, --version Display Zint version\n" " -v, --version Display Zint version\n"
" --vwhitesp=INTEGER Set height of vertical whitespace in multiples of X-dim\n" " --vwhitesp=INTEGER Set height of vertical whitespace in multiples of X-dim\n", stdout);
" -w, --whitesp=INTEGER Set width of horizontal whitespace in multiples of X-dim\n", stdout); fputs( " -w, --whitesp=INTEGER Set width of horizontal whitespace in multiples of X-dim\n"
fputs( " --werror Convert all warnings into errors\n", stdout); " --werror Convert all warnings into errors\n", stdout);
} }
/* Display supported ECI codes */ /* Display supported ECI codes */
@@ -1255,6 +1256,7 @@ static void win_free_args(void) {
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
static WCHAR **win_CommandLineToArgvW(const WCHAR *cmdline, int *numargs) { static WCHAR **win_CommandLineToArgvW(const WCHAR *cmdline, int *numargs) {
int qcount, bcount; int qcount, bcount;
const WCHAR *s; const WCHAR *s;
@@ -1640,7 +1642,7 @@ int main(int argc, char **argv) {
#endif #endif
{"textgap", 1, NULL, OPT_TEXTGAP}, {"textgap", 1, NULL, OPT_TEXTGAP},
{"types", 0, NULL, 't'}, {"types", 0, NULL, 't'},
{"verbose", 0, NULL, OPT_VERBOSE}, /* Currently undocumented, output some debug info */ {"verbose", 0, NULL, OPT_VERBOSE},
{"vers", 1, NULL, OPT_VERS}, {"vers", 1, NULL, OPT_VERS},
{"version", 0, NULL, 'v'}, {"version", 0, NULL, 'v'},
{"vwhitesp", 1, NULL, OPT_VWHITESP}, {"vwhitesp", 1, NULL, OPT_VWHITESP},
+4 -4
View File
@@ -239,10 +239,10 @@ echo testing EAN-14
zint -o bar72.txt -b 72 -d 3210987654321 zint -o bar72.txt -b 72 -d 3210987654321
zint -o bar72.gif -b 72 --height=50 --border=10 -d 3210987654321 zint -o bar72.gif -b 72 --height=50 --border=10 -d 3210987654321
zint -o bar72.svg -b 72 --height=50 --border=10 -d 3210987654321 zint -o bar72.svg -b 72 --height=50 --border=10 -d 3210987654321
echo testing Codablock-F echo testing Codablock F
zint -o bar74.txt -b 74 -d "Demonstration Codablock-F symbol generated by libzint" zint -o bar74.txt -b 74 -d "Demonstration Codablock F symbol generated by libzint"
zint -o bar74.gif -b 74 -d "Demonstration Codablock-F symbol generated by libzint" zint -o bar74.gif -b 74 -d "Demonstration Codablock F symbol generated by libzint"
zint -o bar74.svg -b 74 -d "Demonstration Codablock-F symbol generated by libzint" zint -o bar74.svg -b 74 -d "Demonstration Codablock F symbol generated by libzint"
echo testing NVE-18 echo testing NVE-18
zint -o bar75.txt -b 75 -d 76543210987654321 zint -o bar75.txt -b 75 -d 76543210987654321
zint -o bar75.gif -b 75 --height=50 --border=10 -d 76543210987654321 zint -o bar75.gif -b 75 --height=50 --border=10 -d 76543210987654321
+7 -2
View File
@@ -52,7 +52,12 @@ target_link_libraries(${PROJECT_NAME} QZint
Qt${QT_VERSION_MAJOR}::UiTools Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::UiTools Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Svg
Qt${QT_VERSION_MAJOR}::Core) Qt${QT_VERSION_MAJOR}::Core)
get_property(libdir GLOBAL PROPERTY ZINT_LIBDIR) if(APPLE AND NOT CMAKE_INSTALL_RPATH)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${libdir}") get_property(libdir GLOBAL PROPERTY ZINT_LIBDIR)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${libdir}")
endif()
install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR}" RUNTIME) install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR}" RUNTIME)
if(UNIX)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../docs/zint-qt.1" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" COMPONENT doc)
endif()
+4 -4
View File
@@ -127,7 +127,7 @@ static const struct bstyle_item bstyle_items[] = {
{ QSL("Brazilian Postal Code (CEPNet)"), BARCODE_CEPNET }, { QSL("Brazilian Postal Code (CEPNet)"), BARCODE_CEPNET },
{ QSL("Channel Code"), BARCODE_CHANNEL }, { QSL("Channel Code"), BARCODE_CHANNEL },
{ QSL("Codabar (EN 798)"), BARCODE_CODABAR }, { QSL("Codabar (EN 798)"), BARCODE_CODABAR },
{ QSL("Codablock-F (and HIBC)"), BARCODE_CODABLOCKF }, { QSL("Codablock F (and HIBC)"), BARCODE_CODABLOCKF },
{ QSL("Code 11"), BARCODE_CODE11 }, { QSL("Code 11"), BARCODE_CODE11 },
{ QSL("Code 128 (ISO 15417) (and GS1-128 and HIBC)"), BARCODE_CODE128 }, { QSL("Code 128 (ISO 15417) (and GS1-128 and HIBC)"), BARCODE_CODE128 },
{ QSL("Code 16K (EN 12323)"), BARCODE_CODE16K }, { QSL("Code 16K (EN 12323)"), BARCODE_CODE16K },
@@ -236,7 +236,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
m_btnHeightPerRowDisable(nullptr), m_btnHeightPerRowDefault(nullptr), m_btnHeightPerRowDisable(nullptr), m_btnHeightPerRowDefault(nullptr),
m_scaleWindow(nullptr) m_scaleWindow(nullptr)
{ {
// Undocumented command line debug flag // Command line debug flag
m_bc.bc.setDebug(QCoreApplication::arguments().contains(QSL("--verbose"))); m_bc.bc.setDebug(QCoreApplication::arguments().contains(QSL("--verbose")));
QCoreApplication::setOrganizationName(QSL("zint")); QCoreApplication::setOrganizationName(QSL("zint"));
@@ -817,7 +817,7 @@ void MainWindow::about()
"<p>A free barcode generator</p>" "<p>A free barcode generator</p>"
"<p>Instruction manual is available at the project homepage:<br>" "<p>Instruction manual is available at the project homepage:<br>"
"<a href=\"https://www.zint.org.uk\">https://www.zint.org.uk</a>.</p>" "<a href=\"https://www.zint.org.uk\">https://www.zint.org.uk</a>.</p>"
"<p>Copyright &copy; 2006-2025 Robin Stuart and others.<br>" "<p>Copyright &copy; 2006-2026 Robin Stuart and others.<br>"
"Qt backend by BogDan Vatra.<br>" "Qt backend by BogDan Vatra.<br>"
"Released under GNU GPL 3.0 or later.</p>" "Released under GNU GPL 3.0 or later.</p>"
"<p>Qt version %2. Qt settings:<br>%3</p>" "<p>Qt version %2. Qt settings:<br>%3</p>"
@@ -1960,7 +1960,7 @@ void MainWindow::change_options()
m_optionWidget = uiload.load(&file); m_optionWidget = uiload.load(&file);
file.close(); file.close();
load_sub_settings(settings, symbology); load_sub_settings(settings, symbology);
tabMain->insertTab(1, m_optionWidget, tr("Codablock&-F")); tabMain->insertTab(1, m_optionWidget, tr("Cod&ablock F"));
btype->setItemText(0, tr("Default (bind)")); btype->setItemText(0, tr("Default (bind)"));
connect(get_widget(QSL("cmbCbfWidth")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview())); connect(get_widget(QSL("cmbCbfWidth")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("cmbCbfHeight")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview())); connect(get_widget(QSL("cmbCbfHeight")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
+2
View File
@@ -19,3 +19,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
SPDX-License-Identifier: MIT
+2
View File
@@ -13,3 +13,5 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
SPDX-License-Identifier: ISC