1
0
mirror of https://github.com/woo-j/zint.git synced 2024-12-23 01:33:55 +03:00
Commit Graph

1714 Commits

Author SHA1 Message Date
Harald Oehlmann
1456af0e8b Add nmake.vc build system, add tcl 9 compatibility, half-fix unload, half-add version-info 2024-12-09 19:33:45 +01:00
gitlost
041c74fe4d cmake: bump min version 3.5 -> 3.10 to avoid warning with cmake 31.1;
also add min version to all CMakeLists.txt
GUI: add missing accelerator to UPCA/UPCEAN.ui "Guard Whitespace";
  add default value to some "Default" buttons;
  reformat DAFT examples again; add \^@ to special escs hint
2024-11-25 19:13:25 +00:00
gitlost
e94727f07d MAXICODE: add minimal encoding by Bue Jensen (BWIPP PR #279),
around 20% slower than current but much better;
  numerous other fiddlings
reedsol: reverse result in `rs_*encode*()` routines & adjust
  clients appropriately (may replace later with something faster)
test suite: cater for MAXICODE SCM better; add assert & dataset
  totals
BWIPP: update to latest
gen_gs1_lint.php: restrict line length to 118 for func calls
2024-11-25 09:22:37 +00:00
gitlost
1ae7815d95 zint.h: add version string, mention "manual.html" and website
README: mention "manual.html"
tools/update_version.php: update for "zint.h" version, README year
test suite: fix some clang-tidy-20 warnings
2024-11-18 18:50:26 +00:00
gitlost
86b6a0553b CODE128: optimize for extended ASCII as well using techniques from
BWIPP minimal encoding by Bue Jensen (BWIPP PR #278);
  new extra escape `\^@` to turn off manual switching
zint.h: increase `symbol->text` size 200 -> 256 (means that for
  the moment can no longer generate ZINT_WARN_HRT_TRUNCATED)
GS1_128/GS1_128_CC: warn if READER_INIT option used
CODE16K: move `c16k_set_a/b/c()` routines from "code128.c" and
  rename `c16k_` (also `C128_` defines to `C16K_`)
common: make `itoc()` simple macro which adds '0' (>= 10 now ':',
  ';' etc) and adjust `expand()` accordingly for slight speed-up
general: EXTRA_ESCAPE_MODE now implies ESCAPE_MODE
tests: update BWIPP to latest and enable CODE128AB ("suppressc");
  new test args '-n' (exclude func) and '-m' (match func)
2024-11-18 05:08:52 +00:00
gitlost
c9909d3d91 tests: BWIPP: update CODE128/MAXICODE to use "newencoder"
BWIPP: update to latest
AZTEC/CODE16K/DATAMATRIX: harmonize GS1 and READER_INIT error
  messages
2024-11-12 11:25:22 +00:00
gitlost
88155343bf MAXICODE: maintain current set between segments to prevent invalid
encodation;
  use code set E for padding as well, saves codeword, props Bue
  Jensen (BWIPP PR #279);
  add padding after all segments and limit loops to length to make
  NS compression work better;
  all the above temporary fixes until Bue Jensen's merge request
  with the BWIPP PR #279 algorithm
GUI: expand linux "xcb" platform hack for >= Qt 5.1
2024-11-08 16:54:38 +00:00
gitlost
f1f283d6a1 docs: update doc images and ChangeLog for last commit [705b72] 2024-11-05 23:18:42 +00:00
gitlost
705b7254f2 UPCA/UPCE: descend add-ons to same level as guards following
ISO/IEC 15420:2009 4.3.5 (and BWIPP) and adjust righthand outside
  digit to be 4X/2X instead of 5X/3X (ISO/IEC 15420:2009
  Annex A.2) away from main symbol so as not to touch add-on
  TODO: revisit when standard clarified
2024-11-05 22:50:03 +00:00
gitlost
71b2dc50b7 library: move check for valid UTF-8 after de-escaping
CODE128: fix bad index 0 -> i in `c128_glyph_count()`
2024-10-30 16:37:42 +00:00
gitlost
7e6da28761 tests: test_library: fix snafus from previous commit [5e2044]
(Windows)
2024-10-27 22:19:43 +00:00
gitlost
5e2044ff2e CODE128: reduce extended latch cut-off from 5 to 4 for better
encodation in certain cases (and no pessimizations found so far),
  props lyngklip (BWIPP);
  fix extended char latching when exactly 3 extended chars at end;
  count code set C (not digits) in loop deciding when to
  shift/latch to extended for better estimate
AZTEC: return warning if ECC < 5% (due to bit-stuffing when version
  given); return error if > 22 layers (Zint 26) for Reader
  Initialisation symbol requested for better error message
AZTEC/HANXIN/QRCODE: consolidate different ECC data size tables
  into one indexed by ECC
DBAR_EXP: check for reduced length <= 77 up front for better error
  message
HANXIN: use `malloc()` rather than `z_alloca()` for large binary
  array
QRCODE: `ecc_level` now 0-based (not 1-based)
MICROQR: consolidate different version end routines into one
  `microqr_end()` and use new `microqr_data` table to simplify code
MICROPDF417: use table for max codewords per column
library: centralize all error messages using new `errtxt()`,
  `errtxtf()`, `errtxt_adj()` funcs that protect `symbol->errtxt`
  from overflow, & try to make error messages more consistent
  thru-out, adding more feedback info to many, & use positional
  args "%n$" in prep for l10n (maybe);
  `is_sane/is_sane_lookup()` -> `not_sane/not_sane_lookup()`,
  returning 1-based position (zero on failure) instead of bool;
  `long` ints -> plain `int` (except those dealing with `ftell()`,
  `fread()` etc) as depend on int being 32-bits already
GUI: in "grpDATF.ui" use "PlainText" rather than "RichText" for
  tracker ratio examples as height of text messing up sometimes
manual: clarify Codablock-F length maximum & add examples
docs: README: pandoc 3.5, Ubuntu 24.04
CMake: use "-Wpedantic" for Clang only as GNU complains about
  `errtxtf()` positional args "%n$"
2024-10-27 21:33:33 +00:00
gitlost
752c1fae5d MAXICODE: Zero-pad US postcodes that lack "+4" (Annex B.1.4a)
Adapted from OkapiBarcode, with stricter interpretation (only pad
  if "+4" totally absent), props Daniel Gredler
gs1: update to latest gs1-syntax-dictionary (linter mm -> mi)
bwipp: update to latest
2024-10-09 18:25:38 +01:00
gitlost
c1666cf350 GUI: use X11 (xcb) as platform instead of Wayland on Linux to
avoid various weird behaviours
tests: disable GUI-dependent tests (`TestQZint::renderTest()`) if
  ZINT_SANITIZE and on Linux for later versions of Qt (5 and 6)
  to avoid ASAN "detected memory leaks" errors on exit
2024-10-07 16:04:22 +01:00
gitlost
34be69d241 library: check d/o escape seq value <= 255, better error messages
GUI: cliwindow: `#if _WIN32` -> `#ifdef _WIN32`, add "-Wundef"
  check to cmake
cmake: backend: add C90 (C89) compat compiler check
docs: update "README" pandoc, "README.linux" (Fedora 39 -> 40)
tests: test_png: add some more text examples
2024-09-29 15:18:56 +01:00
gitlost
b42d5baf4c gs1: New AIs 7041 (GSCN 23-272) (packagetype) and 716 (GSCN-24-157)
CODE49: Better error message on ZINT_ERROR_TOO_LONG
manual: Use floating pt notation for floating pt args on options
backend/tools/data: Remove overlooked "GB2312.TXT" from git
raster: `size2` -> `prev_size`; one line `malloc()`s
C25/CODE128: some code fiddling
tests/PNG: Add some more text examples
2024-09-18 03:40:45 +01:00
gitlost
93c3e27fba CODE128: Add minimal encodation algorithm (non-extended ASCII only)
from ZXing (props Alex Geller) - about 25-60% slower depending on
  data & stack heavy but does improve some outcomes when FNC1s
  present (GS1_MODE or manual) although not much else it appears
  (the previous algorithm was very good), but has a logical clarity
  the other lacked - funcs `c128_dxsmooth()` etc shared with
  CODE16K now moved there and renamed as `c16k_`;
  also fix extended char latching when exactly 4 extended chars
  at end
  also manual code set switching now honoured exactly even if
  immediate shift required;
manual: make explicit that AI "(00)" and "(01)" prefixes added by
  Zint are HRT-only
general: add `extern "C"` wrappers to a few header files
2024-09-07 12:44:16 +01:00
gitlost
10747d6385 CODE128: Add new extra escape \^1 for manual insertion of FNC1s,
ticket #324, props Jim Shank;
  also improve encodation for a few limited cases;
  also some code fiddling
BWIPP: update to latest
raster: check for overflow on `size + size2` in `raster_malloc()`
vector: put `malloc()`s on one line for grep ease
docs: pandoc-3.3, clang-tidy-20
2024-09-03 11:55:55 +01:00
gitlost
7f4ccccb98 GS1: update to latest gs1-syntax-dictionary, new AI 8014 (GSCN
21-283) MUDI, and AI 03 MTO GTIN);
  hhmm -> hh,mm, mmoptss -> mm,ss, yymmddhh obsolete
2024-07-30 13:11:15 +01:00
gitlost
3c7a702169 test: BWIPP: add fixedeclevel to PDF417/QRCODE variants when
`eclevel` given; update BWIPP to latest
2024-07-22 23:29:37 +01:00
gitlost
9c701f1009 2nd attempt to fix [857021] - add ZINT_NO_PNG define to tests 2024-07-18 01:38:29 +01:00
gitlost
b3a8680a90 Fix previous commit [857021] - allow for ZINT_NO_PNG 2024-07-18 01:26:31 +01:00
gitlost
857021de84 png: allow for use of zlib-ng, a zlib replacement, by Fedora 40,
by avoiding binary comparison in tests
2024-07-18 01:04:50 +01:00
gitlost
fb3b3001aa - GS1: fix square brackets treated as FNC1 in GS1PARENS_MODE by
changing internal FNC1 marker '[' -> '\x1D' (GS), ticket #319,
  props Moli Sojet;
  also fix non-AI square brackets -> round brackets in GS1_128 HRT
- BWIPP: update to latest
2024-07-11 00:35:13 +01:00
gitlost
7246d67175 gs1/gs1_lint: update to latest gs1-syntax-dictionary, removing
`iso3166list` linter and adjusting all others to allow for
  multiple optional linters (by checking `data_len` vs `offset`)
library: change invalid `input_mode` reset to return warning;
  split func table into 2 - func declarations without prototype
  will be error in C23;
  make invalid symbology check a separate function using a table
  and call near beginning of `ZBarcode_Encode_Segs()`;
  in `ZBarcode_BarcodeName()` save some bytes by simplifying
  name table and removing "BARCODE_" prefix from entries
output: fix pack logic to use pragma by default (actually more
  portable than `__attribute__`)
common.h: remove C99 detection which was artifice of specifying
  "-std=", and rejig layout to be more logical
BWIPP: update to latest version
general: change `ZINT_VERSION_BUILD` tests to `#if`s
general: further fiddling with some tables to save a few bytes
CLI: change function arg `optarg` -> `arg` so doesn't shadow
  global
general: library now compilable with Comp Cert C (though as it
  doesn't support `alloca()` will have multiple memory leaks)
2024-06-27 23:00:13 +01:00
gitlost
d70edce067 iso4217: new ISO 4217 currency code 924 for ZWG (amendment no. 177)
(gs1-syntax-dictionary commit [d64e28d])
  TODO: remove 932 ZWL 1 Sept 2024
2024-06-21 16:31:19 +01:00
gitlost
d97fc7e110 CMake: use "GNUInstallDirs" instead of old (2008) KDE
"SetPaths.cmake" (removed) - resolves absolute paths in
  "zint-targets.cmake", ticket #318, props John Alexander;
  also remove "FindZint.cmake" install as not best practice
  (Daniel Pfeifer “Effective CMake"), but retain in tree for now;
  also remove APPLE stuff re UNIVERSAL build, obsolete, and
  setting of CMAKE_OSX_SYSROOT, seems unnecessary
2024-06-21 15:18:00 +01:00
gitlost
04e8cacb81 gs1: Update to latest version of gs1-syntax-dictionary with new AIs
7250-7259 (GSCN 22-246), new checkers `yyyymmdd()`, `iso5218()`,
  `posinseqslash()`; allow for new "?" flag in "gen_gs1_lint.php"
2024-05-29 22:52:34 +01:00
gitlost
83fe2f3fee getopt: fix previous #ifdef 1 -> #if 1 2024-05-28 02:48:08 +01:00
gitlost
a1aefdc50b test_library: suppress size_t -> int warning
getopt: suppress `-Wdeprecated-non-prototype` warnings
2024-05-28 02:39:49 +01:00
gitlost
eb035a6372 GUI: fix foreground/background picker invocations (broken
[f3a982c1dd])
AZTEC/CODE16K/CODEONE/DATAMATRIX/DBAR_EXP/GRIDMATRIX/HANXIN
/MAILMARK_4S/PDF417/MSI_PLESSEY/QRCODE/RMQR/TIF/ULTRA/USPS_IMAIL:
  lessen storage of some tables by using least integral size
  required (saves ~3K); reformat some tables, comments
AUSPOST/AZTEC: remove unnecessary int casts on array indexing
CODE11/CODE39: move start/stop chars into one entry in tables to
  save a few bytes; some reformatting, comments
CODEONE: add `c1_` prefixes
common: more precise compiler/version checks
composite: add `cc_` prefixes; UINT -> unsigned short; use
  `sizeof()` instead of `strlen()` for `in_linear_comp` static;
  some reformatting, comments
EMF: use table instead of string for `ultra_chars[]`
GIF: remove unnecessary cast
library: use `sizeof()` instead of `strlen()` for static;
  add `consts` to `escape_char_process()` & use unsigned for `ch`
DBAR: use `dbar_`, `dbar_ltd_`, `dbar_exp_` prefixes
docs: update pandoc version
2024-05-27 23:19:45 +01:00
gitlost
0a00d04ccc CMakeLists.txt: check against c not c++ (CheckCXX -> CheckC etc)
BMP/EMF/PCX/TIF: use more portable packed attribute instead of
  pragma if not MSVC
CHANNEL: pass ptr not struct to `channel_copy_precalc()`
2024-05-27 20:55:04 +01:00
gitlost
3960dfdbfc AZTEC: workaround MSVC optimizer deciding not to emit code for
inner top/right/bottom/left loops of `az_populate_map()` by
  jiggling them around a bit, ticket #317, props Andre Maute
frontend/tests: clean up any directories created in `test_input()`,
  ticket #316, props Andre Maute
2024-05-27 03:06:27 +01:00
Philip Ye
c8bb299908 Fix legacy width and security level getters/setters in Qt backend
Previously, width is option 2 and security level is option 1.
Seems like in 54947fb435, the definitions
swapped and that breaks the legacy Qt application using setWidth() and
setSecurityLevel().

I know a better solution is make Qt application use setOption2() and
setOption1() respectively, but it's good to keep these legacy APIs
backward-compatible.
2024-05-23 22:46:26 +12:00
gitlost
0eaa9f3e7d GUI: about box: display QSettings config location 2024-03-07 17:03:56 +00:00
gitlost
5390c0df92 GUI: factory reset: reset preview background colour also 2024-03-07 14:16:22 +00:00
gitlost
bdb4fcbcf8 README.macos/windows: fix modified date year 2014 -> 2024 2024-03-07 13:59:09 +00:00
gitlost
55a7369cd8 output: out_fopen() fix _WIN32 def check (ticket #313, props
Axel Waggershauser)
2024-03-05 22:15:00 +00:00
gitlost
624574a64c As get_best_eci() can no longer return 0 remove caller checks
library: simplify dealing one-letter escapes into one case;
  other fiddlings (`first_err` -> `warn_number`)
2024-03-05 22:09:05 +00:00
gitlost
11b3c18aed ECI: get_best_eci(): just assert is_valid_utf8() as checked
prior to being called
manual: update to latest GS1 General Specifications (v24), pandoc
  (3.1.12.1)
2024-02-28 02:57:43 +00:00
gitlost
f0d8901d9e QRCODE: check fopen() return in ZINTLOG debugging code
(ticket #181, props Stf Ortm)
CODE128: suppress gcc -Wmaybe-uninitialized false positive (Release
  only)
CLI: add "isbn" synonym; save a few bytes using `char[]` rather
  than `char *`
2024-02-27 13:36:13 +00:00
gitlost
f312cdf630 CODE128: simplify bitmask in qr_add_version_info() (ticket #110,
props Daniel Gredler);
  check for next shift rather than next in `c128_dxsmooth()` to
  improve encodation on A/B shifting, props Daniel Gredler (Okapi)
2024-02-10 16:08:18 +00:00
gitlost
e167f5b534 test suite: zxing-cpp: adjust for returnCodabarStartEnd no-op;
allow for old "libpng" (`png_set_scale_16()` not available)
general: Solaris compat
library: use proper function ptr instead of `void *` for function
  table; warning suppression "-Wpedantic" -> "-Wstrict-prototypes"
GRIDMATRIX/HANXIN/QRCODE: `xx_define_mode()`: multi-dim `char_modes`
2024-02-06 13:01:35 +00:00
gitlost
7b41dfbee2 - ITF14/DPLEIT/DPIDENT: ignore option_2 (check digit options)
- GUI: scalewindow: fix cropping resolution on initial setup
  (`spnResolution` max 1000 -> 254000) and bound X-dim to <= 10 in
  `set_maxima()`
- GUI: mainwindow: bound X-dim as above and clamp `m_xdimdpVars`
  members on initial load from INI
- GUI: undo `QString::mid()` -> `QString::midRef()` from clazy
  & explicitly include "QObject" in "qzint.h" (not Qt6 compatible)
2024-01-25 00:10:34 +00:00
gitlost
7c1bdba8ae output: use doubles when converting in out_colour_get_rgb()
and `out_colour_get_cmyk()`, to lessen chances of rounding
  errors (in particular for VC6)
test_large: fix regression in change to test for formatting
  `uint64_t` for `printf()`
win32/README: update MinGW/MSYS Qt version
2024-01-19 09:28:03 +00:00
gitlost
57fac4048d frontend/CMake: fix HAVE_GETOPT -> HAVE_GETOPT_LONG_ONLY 2024-01-17 22:04:18 +00:00
gitlost
1449866d18 CMake: check for getopt_long_only() instead of just getopt()
so behaviour of CLI same
general: AIX compat, suppress some warnings
2024-01-17 21:55:11 +00:00
gitlost
bead450f38 - BMP/EMF/PCX/TIF: fix endianness on big-endian machines (note TIF
now always written as little-endian - simplifies testing)
- READMEs: add date updated
2024-01-17 01:45:45 +00:00
gitlost
cf04ac15b0 general: use explicit float consts rather than calced ones
manual: remove extra tags from "manual.txt" and clean up table
  captions
2024-01-09 18:38:21 +00:00
gitlost
f3a982c1dd fuzz.h: fix upper/lowercase flags
GUI: suppress clazy warnings
2024-01-05 22:55:57 +00:00