1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-05-01 11:45:29 +00:00

1355 Commits

Author SHA1 Message Date
gitlost
b0b8c28380 postal/qzint: suppress some "-Wshorten-64-to-32" warnings
auspost: check z_zero_fill > 0 (pedantic)
2026-04-27 18:05:34 +01:00
gitlost
0959e273a6 test suite: common: z_zero_fill: zeroize dest[] array 2026-04-27 01:16:00 +01:00
gitlost
0a3ffc1dc2 AZTEC: add manual FNC1 support:
improve P/S vs P/L choice when have ECI;
  add ZINT_DEBUG_TEST dump
AUSPOST: allow variable length data input
DATAMATRIX: do `EXTRA_ESCAPE_MODE` processing up front & check have
  non-zero length afterwards;
  disallow `READER_INIT` and `EXTRA_ESCAPE_MODE`;
general: add new `z_zero_fill()` func & use;
  add new `z_extra_escape_position_fnc1()` helper;
  in `z_ct_set_seg_extra_escapes_eci` check position FNC1 whether
  or not have ECI
library: escape_char_process: note escaped backslash followed by
  caret by passes `EXTRA_ESCAPE_MODE` check
test suite: BWIPP: update to latest; support AUSPOST variants;
  process `EXTRA_ESCAPE_MODE` escaping up front
2026-04-27 01:02:25 +01:00
gitlost
b40393723f AUSPOST: support Null FCC (DPID all zeroes); TODO: BWIPP support
CODE128: properly fix not switching before FNC1 in 2nd position
  after alpha (commit [7b0767])
PLANET/KIX: adapt POSTNET to cater for both
general: use static strings to save a few bytes (start/stop in
  particular); various other code fiddles
postal: move tables into funcs
2026-04-22 21:25:16 +01:00
gitlost
7f688b9e58 BWIPP: update to latest, undo DBAR_LTD_CC RHS hack ([7b0767]);
`bs` (begin space) hack no longer needed either
2026-04-21 22:02:04 +01:00
gitlost
8a76981200 testcommon: need <sys/wait.h> for WIFEXITED/WEXITSTATUS
CI: try Qt6 for mac; checkout@v4 -> v6
2026-04-18 23:43:18 +01:00
gitlost
7b076717f2 DATAMATRIX: add manual FNC1 support
CODE128: error on unrecognized extra escape sequences instead of
  just passing them thru;
  fix possible shifting before manual FNC1 in 2nd position
  after single alpha (otherwise won't be recognized as AIM)
  fix not removing manual FNC1 in 1st/2nd position from content
  segs (as implied by symbology identifier)
CLI: warn if both "--dmre" and "--square" given (as "--square"
  overwrites "--dmre")
common: new routines `z_isalpha()`, `z_extra_escapes()` and
  `z_ct_set_seg_extra_escapes_eci()`
library: new helper `supports_extra_escape_mode()`;
  fix some error_number dups
BWIPP: update to latest, and allow for removal of DBAR_LTD_CC RHS
  quiet zones & extra row when have add-on in EAN/UPC composites
test suite: fix BWIPP escaping
manual/man/tcl: update for DATAMATRIX manual FNC1 support
Windows: resource scripts: make more consistent (libzint, CLI, GUI)
win32/README: update with MSVC 2026
2026-04-18 22:55:52 +01:00
gitlost
f9a493522f DATAMATRIX: add new options DM_B256_START and DM_C40_START to
`options_3`, allowing forcing of Base 256 or C40 mode a la BWIPP
  for initial no. of characters specified in `option_1`, with 0
  meaning all (CLI "--dmb256=" and "--dmc40=", GUI also (apart
  from MAILMARK_2D, which may be added later);
  export masks `DM_B256_C40_START_MASK` & `DM_SQUARE_DMRE_MASK` in
  "zint.h"
ZBarcode_Encode_File: report filename (possibly truncated) in error
  message on failed open
GUI: uniquify some accelerators and add some child widget getter
  helpers to "mainwindow.cpp"
backend/DEVELOPER -> backend/README, with some expansion
debian/copyright: a few more fixes
BWIPP/pandoc: update to latest
tests/fuzz: adjust for new DATAMATRIX options
2026-03-30 21:25:22 +01:00
gitlost
3c193d7306 raster/vector: EAN/UPC: fix calculation of image/vector height to
allow for heights smaller than `textoffset` when have add-on
  (buffer overflow for raster, outside vector height for vector)
raster: EAN/UPC: make sure don't overwrite add-on stuff when
  line-copying guard descenders by limiting copy width
ZBarcode_Encode_Segs: allow for multiple (stacked) rows when
  setting absolute minimum height;
  state stacked symbols max in error message
DBAR_EXP: check length on encoding method 6 before trying to parse
  3-digit currency string with `z_to_int()`
CLI: stop looping over data args when have error;
  suppress taint warning by using fixed `malloc()` size for
  `arg_opts` instead of `argc`
general: use `vsnprintf()` instead of `vsprintf()` if not C89
ULTRACODE: don't call `ult_generate_codewords()` if `length` 0
  from fragment processing (avoids `assert()`)
clang-tidy -> 23 & suppress some warnings
test suite: fuzz: leave Z_FUZZ_DEBUG to compiler, fix comment
general: some minor code-formatting on touched files
README.deb -> README.debian (avoid confusion with actual ".deb")
BWIPP: update to latest
2026-03-26 17:35:13 +00:00
gitlost
56fca5b2a1 raster/vector: fix BARCODE_BIND_TOP trumping BARCODE_BOX
backend/tests/fuzz: update "fuzz.h" to take `option_3` min/max;
  update `INPUT_MODE_MASK` & `OUTPUT_OPTIONS_MASK`;
  set `height`, `border_width` & `output_options` from input
  (removing `Z_FUZZ_SET_OUTPUT_OPTIONS` conditional) and call
  `ZBarcode_Encode_and_Print()` instead of `ZBarcode_Encode()`;
  support standalone builds of "fuzz_data" & "fuzz_gs1" with
  `Z_FUZZ_MAIN_READ_ARGV_1` macro;
  update "fuzz_gs1" & "fuzz_gs1.dict" to better test caret/raw
  modes;
  gen_corpora: add `output_options`, `height` & `border_width` &
  find (3rd) from fuzz_data of BIND_TOP | BIND_BOX bug
2026-03-22 15:05:53 +00:00
gitlost
f6174cba04 raster/vector: allow for separator height being > twice row height
(ticket #353, props Simon Resch)
2026-03-19 17:52:12 +00:00
gitlost
d7b0daae5b debian/copyright: some more missing attributions 2026-03-19 13:01:30 +00:00
gitlost
a9eef19aae pdf417.h/pdf417_tab.h: remove Copyright (C) 2004 Grandzebu and fix
and expand comments
debian/copyright: add some missing attributions
2026-03-18 23:27:51 +00:00
gitlost
df64a0f237 debian: updated using https://salsa.debian.org/debian/zint as
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
2026-03-18 15:08:32 +00:00
gitlost
db03f0b304 gs1_lint_parse_raw_caret: check that data of AIs with non-predefined
lengths are terminated with separators (unless last)
  (ticket #352, props Simon Resch)
2026-03-18 14:24:40 +00:00
gitlost
b3a3c0d3b4 AZTEC: use algorithm adapted from ZXing for optimized encodation
(ticket #347), props Frank Yellin and Rustam Abdullaev;
   also improve performance of `FAST_MODE`
DATAMATRIX: assert max size on `edges` will fit in unsigned short;
   use MASK for DMRE/SQUARE `option_3` setting
PDF417: assert max size on `edges` will fit in unsigned short
GUI: fix setting AZTEC size and ECC combos if not previously set
manual: fix not mentioning AZTEC re `FAST_MODE`;
  gs1 mode footnote: mention 3940's length; pandoc -> 3.9
test suite: DOTCODE: account for new BWIPP input length guard
2026-03-11 15:48:24 +00:00
gitlost
6dd216db85 Fix some typos; add _typos.toml 2026-02-26 22:35:25 +00:00
gitlost
bd33953fc1 general: add -Wshorten-64-to-32 compiler flag & suppress warnings
(ticket #351, props Axel Waggershauser)
2026-02-26 18:23:21 +00:00
gitlost
9ef5bc7298 GS1SE: fix bug in allowing initial GSs in GS1RAW_MODE in composites 2026-02-26 16:34:59 +00:00
gitlost
0a8a79fa6c GS1: new GS1RAW_MODE (CLI "--gs1raw") and GS1 Syntax Engine
"Unbracketed AI" (caret) options for specifying GS1 input
  (ticket #350, props Mario Verbruggen)
DBAR_EXP_CC/DBAR_EXPSTK_CC: fix separator over finder patterns
  when linear part is greater than 4 codeblocks
general: left-over raw_text -> content_segs in comments;
  update & expand some GS1 General Specs refs;
  some minor code fiddling
test suite: suppress some additional ZINT_SANITIZEM false positives
  (& add new ZINT_TESTUTIL_SANITIZEM_INIT helpers)
2026-02-26 15:05:45 +00:00
gitlost
3b24d129d7 CODE32/PZN: fix not restoring option_2 (props axxel) 2026-02-05 02:39:04 +00:00
gitlost
1a7e174b6a AZTEC: az_punct_size(): small perf. improvement 2026-02-03 05:07:06 +00:00
gitlost
bcb3ceefe1 AZTEC: add almost optimal encoding algorithm, previous algorithm
available via "--fast" (input_mode |= FAST_MODE) (ticket #347);
  add new option "--azfull" (option_3 = ZINT_AZTEC_FULL) to only
  consider Full symbols (not Compact ones) on automatic sizing
GUI: adjust Aztec tab to show feedback by selecting combos and
  shorten message to just actual ECC;
  grpCodabar min width
library: debug source input dump 200 -> 2000
common: some code fiddling (c -> ch, flg -> flag)
backend_tcl: add "-azfull" option & make capitalization of
  help more consistent
general: remove some trailing whitespace
manual: make Aztec ECCs more precise, i.e. ">=" rather than ">"
  (similarly in GUI)
CLI: code fiddling c -> opt
2026-02-02 14:20:10 +00:00
gitlost
cf5ef9ec20 GS1SE: exclude GS1_128 from requisite AIs check as may be spread
across multiple barcodes (ticket #348, props Harald Oehlmann and Terry Burton)
2026-01-30 12:09:13 +00:00
gitlost
0efc4fb021 AZTEC: fix ECC to be at least advertised percentages (ticket #347,
props Francois Grieu)
2026-01-21 12:01:00 +00:00
gitlost
eea16e1a89 DOTCODE: fix not emitting FNC1 (signalling non-GS1) when input
just 2 digits
cmake: set `rpath` of CLI frontend on macOS install (ticket #346,
  props Hagen Röwer)
cmake: make uninstall: update to use `-E rm` if available, warn
  rather than fatal error if fail to remove, note if leaving
  "/zint" directory unremoved (i.e. "lib/cmake/zint")
library: de-duplicate errtxt no.
test suite: update BWIPP to latest
test suite: test_bwipp: enable & fix dotcode random test
test suite: fuzz: gen_corpora fuzz_data 1st -> 2nd
2026-01-18 19:14:10 +00:00
gitlost
74c9e7a9a7 BWIPP: need to set enabledontdraw in "bwipp_dump-barcode.ps.cat";
update to latest
2026-01-13 03:20:43 +00:00
gitlost
6e533c7a0a CODE128: fix not handling FNC1 at end of data when in manual
switching mode or any FNC1 after manual C mode selected and no
  other non-C data - found by fuzz test "fuzz_data" - 2nd ever
  trophy!
qr.h: fix typo (props https://github.com/crate-ci/typos)
2026-01-12 20:38:15 +00:00
gitlost
a718c79237 ZBarcode_Encode_Segs: fuller debug output (all input fields)
test suite: fuzz: update for new symbologies & suppress some
  clang-tidy warnings
common: better `z_iscntrl()`
BWIPP: update to latest
2026-01-11 20:51:18 +00:00
gitlost
64aa8e654c QRCODE: implement pre-calculated QR/MICROQR masks ala BWIPP for a
slight performance gain (2-3%), see
  https://sourceforge.net/p/zint/mailman/message/59278637/
  - generated by "backend/tools/gen_qr_masks.php"
test suite: update BWIPP to latest
2026-01-06 11:50:06 +00:00
gitlost
973594a624 GUI: DAFT: re-squash tracker examples back to 2 lines so should
always fit (wasn't on Fedora/GNONE) but make non-wrap
CMake: remove Qt6 regex detect nonsense and note must specify
  `-DZINT_QT6=ON` in "README.linux"
2026-01-01 18:53:30 +00:00
gitlost
848b364df0 CLI: fix bug in "--scalexdimdp" in converting from "in" to "mm"
(was dividing instead of multiplying doh);
  make "--scalexdimdp" units check error messages better;
  add more "--test" tests & have `validate_units()` etc take
  `errbuf` arg to make them more test-friendly
GUI: `copy_to_clipboard()` unshadow `data` -> `fdata`
test suite: make `utf8_to_wide()` same as "backend/output.c" & fix
  return vals;
  add `QZint::save_to_memfile()` test
2025-12-31 14:57:13 +00:00
gitlost
b434202817 backend_qt: new method save_as_memfile() to save as
`BARCODE_MEMORY_FILE` and use in GUI for pasting to clipboard
  instead of creating temporary file
CLI: allow fully case-insensitive "tiff" as filetype (saved as
  ".tif"), processing up to 4-letter extensions and hopefully
  making filetype handling more expected;
  simplify `validate_float()` (unneeded 2nd fractional max test);
  add some more internal "--test" tests
BWIPP: update to latest (change from ctx to global VM) - zint tests
  work as-is, no change
2025-12-29 17:46:24 +00:00
gitlost
b2ad19a455 Bump to version 2.16.0.9 (dev) 2025-12-19 20:36:40 +00:00
gitlost
55541e139e Version 2.16.0 2025-12-19 19:42:13 +00:00
gitlost
2ac0e508b8 GS1: update to latest gs1-syntax-dictionary (new AIs 717
(GSCN 25-199) and 8040-3 (GSCN 25-047)
manual: fix grammar "chose" -> "choose"
win32/README: add missing "of"
pandoc: update to latest
bwipp: update to latest
testcommon: allow for GS1PARENS_MODE now implying ESCAPE_MODE;
  allow for `input_mode` option `GS1SYNTAXENGINE_MODE`
CI: freebsd: use latest version 1
2025-12-09 16:43:57 +00:00
gitlost
f0c7248b62 general: raw_segs -> content_segs, BARCODE_RAW_TEXT ->
`BARCODE_CONTENT_SEGS`, `z_rt_XXX()` -> `z_ct_XXX()`;
  move `encoded_data`/`row_height` to end of `zint_symbol`
  (see ZXing-C++ issue #883)
manual: update re `content_segs`; `my_symbol` -> `symbol`;
  improve MicroPDF417 description
2025-11-04 23:02:10 +00:00
gitlost
543696cb06 ECI: ECI 899 binary in UNICODE_MODE now converted from UTF-8,
not treated literally as it was before, which was inconsistent
  (literal interpretation now requires `DATA_MODE`)
2025-10-16 18:23:48 +01:00
gitlost
a3cca33f32 general: suppress clang-tidy-21/22 warnings;
some code fiddling on affected files
manual: use new lua filter "lua-crossrefs.lua" hacked from
  https://github.com/rnwst/pandoc-lua-crossrefs as replacement for
  tablenos which broke with pandoc 2.8.2 (get nicer output anyway);
  fix "excode39.svg" data $ -> # to avoid shell processing;
  document `ZBarcode_HaveGS1SyntaxEngine()`
2025-10-08 12:21:29 +01:00
gitlost
d2b4904401 gs1: Use new gs1_encoders_init_ex() API;
remove refs to EXCLUDE_GS1_SYNTAX_DICTIONARY
2025-10-02 11:34:45 +01:00
gitlost
4d301ea560 win32: add "zint_dll_vc6" sub-directory with VC6 workspace for
creating "zint.dll" compatible with Windows XP (see ticket #339)
win32: rename README and HOWTO files to uppercase and update
  "win32\README.txt"
general: suppress some VC6 warnings
README.bsd: update
2025-09-26 13:52:55 +01:00
gitlost
5138d0703c CLI: --gs1XXX args now imply `--gs1
GUI: fix chkGS1Strict enabling on startup regression from previous
  commit; update CLI equivalence with --gs1strict & adjust for
  implied --gs1; add tests
CMake: allow lpng/zlib and gs1encoders to take paths (for Windows)
win32/README: simplify locating lpng/zlib/gs1encoders for cmake
  using above; add note on 64-bit build
manual/man page: adjust for various above changes
2025-09-16 10:10:30 +01:00
gitlost
008dff4aec Suppress gcc-15 warning -Wunterminated-string-initialization
ci: macOS: try GS1 Syntax Engine agin
2025-09-12 22:49:28 +01:00
gitlost
e340a60adb And in tests cmake 2025-09-12 04:40:03 +01:00
gitlost
2084b33d5e cmake: fix GS1SE NOTFOUND test 2025-09-12 04:32:52 +01:00
gitlost
0650d5798e Integrate GS1 Syntax Engine 2025-09-12 04:20:55 +01:00
gitlost
ad95d8f2b0 general: fix some typos using https://github.com/crate-ci/typos
(see gs1-syntax-engine PR #15, props Viktor Szépe)
2025-09-07 17:40:43 +01:00
gitlost
9b4d097516 RAW_TEXT: change source to be unconverted, i.e. UTF-8 (unless
`DATA_MODE`); allows ZXing-C++ to be built in writer-only mode
  without needing "libzueci"
library: in GS1 mode check that ECI if any is ASCII compatible
general: some code fiddling, `mode` -> `modes`
2025-09-05 17:23:18 +01:00
gitlost
44e2099a65 library: use "filemem" for TXT dump_plot() -> txt_hex_plot()
filemem: remove NOLINTS (clang-tidy-20 bug fixed)
QRCODE: eliminate NOLINTs using some more asserts (clang-tidy-20);
  some "de-branching" of loops
general: various code fiddlings, in particular lessen no. of
  redundant parenthesized expressions, especially in conditionals,
  which reduce rather than aid readibility IMNSHO
manual: mention "--dump" option
2025-08-28 20:34:56 +01:00
gitlost
39380d6767 general: prefix all INTERNAL funcs/tables with zint_, except
those in "backend/common.h", which are prefixed by `z_` - makes
  symbol clashes more unlikely when zint is statically linked
  (ticket #337, props Ulrich Becker)
DOTCODE: fix padding allowance (10 -> 52 - probable max 35) to
  cover cases with large no. of columns requested and little data,
  to prevent `codeword_array` buffer overflow
AZTEC/CODEONE: some code fiddling
general_field: prefix defines with `GF_`, shorten static funcs
  prefix `general_field_` -> `gf_`
2025-08-26 23:48:00 +01:00