Skip to content

Commit 9851247

Browse files
committed
Update zint to 2.16
1 parent b279b42 commit 9851247

80 files changed

Lines changed: 7883 additions & 6812 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set(APP_VERSION ${CMAKE_PROJECT_VERSION})
1313

1414
option(USE_QZXING "Build with QZXing support (decoder&encoder)" OFF)
1515
option(USE_ZXINGCPP "Build with zxing-cpp support (decoder&encoder)" ON)
16-
option(USE_ZINT "Build with zint support (encoder)" OFF)
16+
option(USE_ZINT "Build with zint support (encoder)" ON)
1717

1818
################################################################################
1919

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Qt 6.x "minor" versions are full of major breakages, it's just not feasible to s
1313
Available backends:
1414
- QZXing / v3.3.0 + Qt6 port + many patches
1515
- zxing-cpp / v2.3.0 + custom QML integration
16-
- zint / v2.15 + custom QML integration
16+
- zint / v2.16 + custom QML integration
1717

1818
> Works on Android and iOS!
1919

qml/ScreenAboutFormats.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Flickable {
9898
ListModel {
9999
id: zint
100100
property string name: "zint"
101-
property string version: "2.15"
101+
property string version: "2.16"
102102
ListElement { type: "linear"; name: "Channel Code"; decode: 0; encode: 1; }
103103
ListElement { type: "linear"; name: "Codabar"; decode: 0; encode: 1; }
104104
ListElement { type: "linear"; name: "Code 11"; decode: 0; encode: 1; }

thirdparty/zint-qml/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project(zint-package)
88
set(CMAKE_INCLUDE_CURRENT_DIR ON)
99

1010
set(ZINT_VERSION_MAJOR 2)
11-
set(ZINT_VERSION_MINOR 15)
11+
set(ZINT_VERSION_MINOR 16)
1212
set(ZINT_VERSION_RELEASE 0)
1313
set(ZINT_VERSION_BUILD 0) # Set to 0 before release, set to 9 after release
1414
set(ZINT_VERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}.${ZINT_VERSION_RELEASE}.${ZINT_VERSION_BUILD}")
@@ -23,11 +23,12 @@ option(ZINT_TEST "Set test compile flag" OFF)
2323
option(ZINT_COVERAGE "Set code coverage flags" OFF)
2424
option(ZINT_SHARED "Build shared library" ON)
2525
option(ZINT_STATIC "Build static library" OFF)
26+
option(ZINT_FRONTEND "Build frontend" OFF)
27+
option(ZINT_USE_GS1SE "Build with GS1 Syntax Engine" OFF)
2628
option(ZINT_USE_PNG "Build with PNG support" OFF)
2729
option(ZINT_USE_QT "Build with Qt support" OFF)
2830
option(ZINT_QT6 "If ZINT_USE_QT, use Qt6" OFF)
2931
option(ZINT_UNINSTALL "Add uninstall target" OFF)
30-
option(ZINT_FRONTEND "Build frontend" OFF)
3132
3233
if(NOT ZINT_SHARED AND NOT ZINT_STATIC)
3334
message(SEND_ERROR "Either ZINT_SHARED or ZINT_STATIC or both must be set")
@@ -195,10 +196,10 @@ if(ZINT_UNINSTALL)
195196
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
196197
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
197198
IMMEDIATE @ONLY)
198-
199+
199200
add_custom_target(uninstall
200201
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
201202
endif()
202203
203204
configure_file("zint-config.cmake.in" "zint-config.cmake" @ONLY)
204-
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zint-config.cmake" DESTINATION "${CMAKE_INSTALL_DATADIR}/zint")
205+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zint-config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/zint")

thirdparty/zint-qml/LICENSE

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
1-
libzint - the open source barcode library
2-
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
1+
ZINT was originally developed by Robin Stuart and licensed under the terms of the GPL (Gnu
2+
Public License). In 2013 Robin Stuart and all developers that contributed to the code agreed
3+
to change the license to a less restrictive one (see ZINT mailing list of May 2013 for
4+
related mails) under the following conditions:
5+
- the names of original copyright holder Robin Stuart and contributors are not removed,
6+
neither from sources nor from the manual
7+
- the documentation is done in British English (as Robin said: "Oh, and please don't
8+
replace the word "colour" with "color" in the documentation - that really annoys me!")
39

4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions
6-
are met:
7-
8-
1. Redistributions of source code must retain the above copyright
9-
notice, this list of conditions and the following disclaimer.
10-
2. Redistributions in binary form must reproduce the above copyright
11-
notice, this list of conditions and the following disclaimer in the
12-
documentation and/or other materials provided with the distribution.
13-
3. Neither the name of the project nor the names of its contributors
14-
may be used to endorse or promote products derived from this software
15-
without specific prior written permission.
16-
17-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
21-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23-
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26-
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27-
SUCH DAMAGE.
10+
Change to BSD-license is done for backend and therefore for ZINT shared library only, for
11+
the frontends and Qt4-backend the GPL is still valid. Since BSD-license is GPL-compatible
12+
this gives the possibility to include ZINT library in own products or link against it from
13+
own software.

thirdparty/zint-qml/README

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Code 2 of 5 Data Logic Micro QR Code
2424
Code 2 of 5 IATA MSI Plessey
2525
Code 2 of 5 Industrial NVE-18 (SSCC-18)
2626
Code 2 of 5 Interleaved PDF417 (and Compact and HIBC)
27-
Code 2 of 5 Standard (Matrix) Pharmacode
28-
Code 32 (Italian Pharmacode) Pharmacode 2-track
27+
Code 2 of 5 Standard (Matrix) Pharmacode One-Track
28+
Code 32 (Italian Pharmacode) Pharmacode Two-Track
2929
Code 39 (and HIBC) Pharma Zentralnummer (PZN)
3030
Code 39 Extended PLANET
3131
Code 49 POSTNET
@@ -38,19 +38,20 @@ Deutsche Post Leitcode Telepen
3838
DotCode Telepen Numeric
3939
DPD Code UK Plessey
4040
Dutch Post KIX Ultracode
41-
EAN (EAN-2, EAN-5, EAN-8 and EAN-13) UPC-A
42-
EAN-14 UPC-E
43-
FIM (Facing Identification Mark) UPNQR
44-
Flattermarken UPU S10
45-
Grid Matrix USPS Intelligent Mail (OneCode)
46-
GS1 Composite (EAN/UPC/DataBar/GS-128) VIN (Vehicle Identification Number)
41+
DX Film Edge Barcode UPC-A
42+
EAN (EAN-2, EAN-5, EAN-8 and EAN-13) UPC-E
43+
EAN-14 UPNQR
44+
FIM (Facing Identification Mark) UPU S10
45+
Flattermarken USPS Intelligent Mail (OneCode)
46+
Grid Matrix VIN (Vehicle Identification Number)
47+
GS1 Composite (EAN/UPC/DataBar/GS-128)
4748

4849
Output can be saved as BMP, EMF, EPS, GIF, PCX, PNG, SVG or TIF.
4950

5051

5152
DOCUMENTATION
5253
-------------
53-
For documentation see "docs/manual.txt" or online at
54+
For documentation see "docs/manual.txt" or "docs/manual.html" or online at
5455

5556
<https://zint.org.uk/manual/>
5657

@@ -62,7 +63,7 @@ Please see "ChangeLog" in the project root directory.
6263

6364
LICENSE
6465
-------
65-
Zint, libzint and Zint Barcode Studio are Copyright © 2023 Robin Stuart. All
66+
Zint, libzint and Zint Barcode Studio are Copyright © 2025 Robin Stuart. All
6667
historical versions are distributed under the GNU General Public License
6768
version 3 or later. Versions 2.5 and later are released under a dual license:
6869
the encoding library is released under the BSD (3 clause) license whereas the
@@ -93,10 +94,8 @@ or join the mailing list at
9394
BEFORE POSTING TO THE LIST
9495
--------------------------
9596
Please note the following points...
96-
* Zint is primarily developed for Linux. While we have some experience of
97-
using Zint on Windows we may be unable to resolve problems if they are
98-
specific to other operating systems. We cannot provide support for using
99-
Zint with commercial packages such as MS Office or Crystal Reports.
97+
* We cannot provide support for using Zint with commercial packages such as MS
98+
Office or Crystal Reports.
10099
* Always ensure you are using the latest version of Zint before posting bug
101100
reports - the bug you are reporting may have been fixed already.
102101
* Please remember to state what operating system you are using and include

thirdparty/zint-qml/backend/2of5.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,25 @@ static int c25_common(struct zint_symbol *symbol, const unsigned char source[],
6262
char *d = dest;
6363
unsigned char local_source[113 + 1]; /* Largest maximum 113 + optional check digit */
6464
const int have_checkdigit = symbol->option_2 == 1 || symbol->option_2 == 2;
65-
const int raw_text = symbol->output_options & BARCODE_RAW_TEXT;
65+
const int content_segs = symbol->output_options & BARCODE_CONTENT_SEGS;
6666

6767
if (length > max) {
6868
/* errtxt 301: 303: 305: 307: */
69-
return ZEXT errtxtf(ZINT_ERROR_TOO_LONG, symbol, error_base, "Input length %1$d too long (maximum %2$d)",
70-
length, max);
69+
return ZEXT z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, error_base, "Input length %1$d too long (maximum %2$d)",
70+
length, max);
7171
}
72-
if ((i = not_sane(NEON_F, source, length))) {
72+
if ((i = z_not_sane(NEON_F, source, length))) {
7373
/* Note: for all "at position" error messages, escape sequences not accounted for */
7474
/* errtxt 302: 304: 306: 308: */
75-
return errtxtf(ZINT_ERROR_INVALID_DATA, symbol, error_base + 1,
75+
return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, error_base + 1,
7676
"Invalid character at position %d in input (digits only)", i);
7777
}
7878

7979
memcpy(local_source, source, length);
8080

8181
if (have_checkdigit) {
8282
/* Add standard GS1 check digit */
83-
local_source[length] = gs1_check_digit(source, length);
83+
local_source[length] = zint_gs1_check_digit(source, length);
8484
length++;
8585
if (symbol->debug & ZINT_DEBUG_PRINT) printf("Check digit: %c\n", local_source[length - 1]);
8686
}
@@ -103,40 +103,40 @@ static int c25_common(struct zint_symbol *symbol, const unsigned char source[],
103103
memcpy(d, start_stop[1], start_length - 1);
104104
d += start_length - 1;
105105

106-
expand(symbol, dest, d - dest);
106+
z_expand(symbol, dest, d - dest);
107107

108-
if (symbol->option_2 == 2 && !raw_text) {
109-
/* Exclude check digit from HRT */
110-
hrt_cpy_nochk(symbol, local_source, length - 1);
111-
} else {
112-
hrt_cpy_nochk(symbol, local_source, length);
108+
/* Exclude check digit from HRT if hidden */
109+
z_hrt_cpy_nochk(symbol, local_source, length - (symbol->option_2 == 2));
110+
111+
if (content_segs && z_ct_cpy(symbol, local_source, length)) {
112+
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
113113
}
114114

115115
return 0;
116116
}
117117

118118
/* Code 2 of 5 Standard (Code 2 of 5 Matrix) */
119-
INTERNAL int c25standard(struct zint_symbol *symbol, unsigned char source[], int length) {
119+
INTERNAL int zint_c25standard(struct zint_symbol *symbol, unsigned char source[], int length) {
120120
/* 9 + (112 + 1) * 10 + 8 = 1147 */
121121
return c25_common(symbol, source, length, 112, 1 /*is_matrix*/, C25MatrixStartStop, 6, 301);
122122
}
123123

124-
/* Code 2 of 5 Industrial */
125-
INTERNAL int c25ind(struct zint_symbol *symbol, unsigned char source[], int length) {
126-
/* 10 + (79 + 1) * 14 + 9 = 1139 */
127-
return c25_common(symbol, source, length, 79, 0 /*is_matrix*/, C25IndustStartStop, 6, 303);
128-
}
129-
130124
/* Code 2 of 5 IATA */
131-
INTERNAL int c25iata(struct zint_symbol *symbol, unsigned char source[], int length) {
125+
INTERNAL int zint_c25iata(struct zint_symbol *symbol, unsigned char source[], int length) {
132126
/* 4 + (80 + 1) * 14 + 5 = 1143 */
133127
return c25_common(symbol, source, length, 80, 0 /*is_matrix*/, C25IataLogicStartStop, 4, 305);
134128
}
135129

136130
/* Code 2 of 5 Data Logic */
137-
INTERNAL int c25logic(struct zint_symbol *symbol, unsigned char source[], int length) {
131+
INTERNAL int zint_c25logic(struct zint_symbol *symbol, unsigned char source[], int length) {
138132
/* 4 + (113 + 1) * 10 + 5 = 1149 */
139133
return c25_common(symbol, source, length, 113, 1 /*is_matrix*/, C25IataLogicStartStop, 4, 307);
140134
}
141135

136+
/* Code 2 of 5 Industrial */
137+
INTERNAL int zint_c25ind(struct zint_symbol *symbol, unsigned char source[], int length) {
138+
/* 10 + (79 + 1) * 14 + 9 = 1139 */
139+
return c25_common(symbol, source, length, 79, 0 /*is_matrix*/, C25IndustStartStop, 6, 303);
140+
}
141+
142142
/* vim: set ts=4 sw=4 et : */

thirdparty/zint-qml/backend/2of5inter.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ static const char C25InterTable[10][5] = {
4343
};
4444

4545
/* Common to Interleaved, and to ITF-14, DP Leitcode, DP Identcode */
46-
INTERNAL int c25_inter_common(struct zint_symbol *symbol, unsigned char source[], int length,
46+
INTERNAL int zint_c25_inter_common(struct zint_symbol *symbol, unsigned char source[], int length,
4747
const int checkdigit_option, const int dont_set_height) {
4848
int i, j, error_number = 0;
4949
char dest[638]; /* 4 + (125 + 1) * 5 + 3 + 1 = 638 */
5050
char *d = dest;
5151
unsigned char local_source[125 + 1];
5252
const int have_checkdigit = checkdigit_option == 1 || checkdigit_option == 2;
53-
const int raw_text = symbol->output_options & BARCODE_RAW_TEXT;
53+
const int content_segs = symbol->output_options & BARCODE_CONTENT_SEGS;
5454

5555
if (length > 125) { /* 4 + (125 + 1) * 9 + 5 = 1143 */
56-
return errtxtf(ZINT_ERROR_TOO_LONG, symbol, 309, "Input length %d too long (maximum 125)", length);
56+
return z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, 309, "Input length %d too long (maximum 125)", length);
5757
}
58-
if ((i = not_sane(NEON_F, source, length))) {
59-
return errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 310,
58+
if ((i = z_not_sane(NEON_F, source, length))) {
59+
return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 310,
6060
"Invalid character at position %d in input (digits only)", i);
6161
}
6262

@@ -72,7 +72,7 @@ INTERNAL int c25_inter_common(struct zint_symbol *symbol, unsigned char source[]
7272

7373
if (have_checkdigit) {
7474
/* Add standard GS1 check digit */
75-
local_source[length] = gs1_check_digit(local_source, length);
75+
local_source[length] = zint_gs1_check_digit(local_source, length);
7676
length++;
7777
}
7878

@@ -96,7 +96,7 @@ INTERNAL int c25_inter_common(struct zint_symbol *symbol, unsigned char source[]
9696
memcpy(d, "311", 3);
9797
d += 3;
9898

99-
expand(symbol, dest, d - dest);
99+
z_expand(symbol, dest, d - dest);
100100

101101
if (!dont_set_height) {
102102
if (symbol->output_options & COMPLIANT_HEIGHT) {
@@ -105,31 +105,32 @@ INTERNAL int c25_inter_common(struct zint_symbol *symbol, unsigned char source[]
105105
width = (P(4N + 6) + N + 6)X = (length / 2) * 18 + 9 */
106106
/* Taking min X = 0.330mm from Annex D.3.1 (application specification) */
107107
const float min_height_min = 15.151515f; /* 5.0 / 0.33 */
108-
float min_height = stripf((18.0f * (length / 2) + 9.0f) * 0.15f);
108+
float min_height = z_stripf((18.0f * (length / 2) + 9.0f) * 0.15f);
109109
if (min_height < min_height_min) {
110110
min_height = min_height_min;
111111
}
112112
/* Using 50 as default as none recommended */
113-
error_number = set_height(symbol, min_height, min_height > 50.0f ? min_height : 50.0f, 0.0f,
113+
error_number = z_set_height(symbol, min_height, min_height > 50.0f ? min_height : 50.0f, 0.0f,
114114
0 /*no_errtxt*/);
115115
} else {
116-
(void) set_height(symbol, 0.0f, 50.0f, 0.0f, 1 /*no_errtxt*/);
116+
(void) z_set_height(symbol, 0.0f, 50.0f, 0.0f, 1 /*no_errtxt*/);
117117
}
118118
}
119119

120-
if (checkdigit_option == 2 && !raw_text) {
121-
/* Exclude check digit from HRT */
122-
hrt_cpy_nochk(symbol, local_source, length - 1);
123-
} else {
124-
hrt_cpy_nochk(symbol, local_source, length);
120+
/* Exclude check digit from HRT if hidden */
121+
z_hrt_cpy_nochk(symbol, local_source, length - (symbol->option_2 == 2));
122+
123+
if (content_segs && z_ct_cpy(symbol, local_source, length)) {
124+
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
125125
}
126126

127127
return error_number;
128128
}
129129

130130
/* Code 2 of 5 Interleaved ISO/IEC 16390:2007 */
131-
INTERNAL int c25inter(struct zint_symbol *symbol, unsigned char source[], int length) {
132-
return c25_inter_common(symbol, source, length, symbol->option_2 /*checkdigit_option*/, 0 /*dont_set_height*/);
131+
INTERNAL int zint_c25inter(struct zint_symbol *symbol, unsigned char source[], int length) {
132+
return zint_c25_inter_common(symbol, source, length, symbol->option_2 /*checkdigit_option*/,
133+
0 /*dont_set_height*/);
133134
}
134135

135136
/* vim: set ts=4 sw=4 et : */

0 commit comments

Comments
 (0)