Commit graph

56 commits

Author SHA1 Message Date
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
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
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
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
06ae7c1b7a CODE11/C25XXX/CODE39/EXCODE39/HIBC_39/CODE93/CODABAR/PLESSEY/
MSI_PLESSEY/FLAT/DAFT/TELEPEN/TELEPEN_NUM: increase allowed
  lengths to max or near-max possible in 1152 modules for most
  (all?) variable length input linear barcodes
USPS_IMAIL: suppress bogus clang-tidy warning re garbage value
  (doesn't take `strlen()` into account?)
2023-11-22 00:45:30 +00:00
gitlost
323b34502b zint.h: increase symbol->text size 160 -> 200;
rename `ZINT_CAP_EXTENDABLE` -> `ZINT_CAP_EANUPC`
  (`ZINT_CAP_EXTENDABLE` marked as legacy)
CODE128: increase no. symbol chars max 60 -> 99
EAN-2/EAN-5: fix `BARCODE_BIND_TOP/BIND/BOX` output
GS1_128: warn if data > 48 (GS1 General Specifications max)
common: `is_extendable()` -> `is_ucpean()`
raster: add `ZFONT_HALIGN_CENTRE/LEFT/RIGHT` flags and process
  in `draw_string()` (for drawing EAN/UPC outside digits), and
  for `ZFONT_HALIGN_CENTRE` round when calculating centre
  (shifts some texts 1 pixel left)
raster/vector: use offsets into `symbol->text` for EAN/UPC
  instead of `out_upcean_split_text()` (removed)
BMP/EMF/GIF/PCX/PNG/PS/SVG/TIF: use new `out_colour_get_rgb()`
  routine (replaces `colour_to_XXX()`)
general: simplify/fix some `error_number` handling/returning
frontend: truncate overlong `--primary` instead of ignoring;
  negative floating pt option (for `--textgap`)
man page: list size detail for matrix symbols (`--vers`)
manual: further fiddling with scaling text; some typos
2023-11-19 19:39:54 +00:00
gitlost
d5235a914b Test suite: some fixes, additions 2023-04-07 15:49:36 +01:00
gitlost
c8033695d9 - API: add new zint_symbol dpmm field for output resolution (BMP/
EMF/PCX/PNG/TIF only, i.e. excluding EPS, GIF & SVG)
- Add support for specifying scale by X-dimension and resolution
  with new option `--scalexdimdp` for CLI/Tcl & new API function
  `ZBarcode_Scale_From_XdimDp()` (+ `ZBarcode_XdimDp_From_Scale()`
  & `ZBarcode_Default_Xdim()`) and new GUI popup; manual: document
- BMP/EMF/PCX/PNG/TIF: use new `dpmm` resolution field (for EMF
  following Inkscape)
- backend_qt: add `dpmm()`, `vectorWidth()`, `vectorHeight()`,
  `noPng()`, `getVersion()`, `takesGS1AIData()`, & `XdimDp` stuff
  incl. new `QZintXdimDp` struct for passing around scale vars &
  use in `getAsCLI()`; add comments
- Raise `scale` limit to 200 (from 100) to allow for large dpmm
- output: create directories & subdirectories as necessary for
  output path using new function `out_fopen()` and use in BMP/EMF/
  EPS/GIF/PCX/PNG/SVG/TIF
- DPLEIT/DPIDENT: format HRT according to (incomplete)
  documentation, and set default height to 72X (from 50X)
- CODE128B renamed to CODE128AB as can use subsets A and/or B
- CODABAR: fix minimum height calc
- EMF: fix indexing of handles (zero-based not 1-based)
- GUI: fix symbology zap (previous technique of clearing and
  re-loading settings without doing a sync no longer works);
  fix UPCEAN guard descent enable
- MAILMARK: better error message if input < 14 characters
- GUI: add "Default" button for DAFT tracker ratio & enable/disable
  various default buttons; use new `takesGS1AIData()` to
  enable/disable GS1-specific checkboxes
- CLI: use new `validate_float()` to parse float options (7
  significant digits allowed only, no scientific notation)
- DATAMATRIX/GRIDMATRIX/PDF417/QR/ULTRA: micro-optimize structapp
  ID parse
- library/CLI: fiddle with static asserts (make CHAR_BIT sensitive,
  supposedly)
- win32/README: update building libpng (assembly removed)
- README.linux: document incompatibility of Qt6 >= 6.3
- manual: expand Barcode Studio waffle
- test suite: change range separator to hyphen and allow multiple
  excludes
2022-12-02 21:39:01 +00:00
gitlost
2f8681b21a - API/CLI/Tcl/GUI: new output option BARCODE_BIND_TOP/--bindtop/
`-bindtop`/"Bind Top"
- DPD: add top boundary (width 3X) by default, using new
  BARCODE_BIND_TOP; "relabel" option; some compliance checks
- GUI: only skip encoded/errored signal processing if active modal
  ExportDialog (wasn't clearing/setting error text bar correctly
  for DataDialog)
- CODE128: debug print checksum
- CODE49/DATAMATRIX/QR/ULTRA: fix uniqueness of errtxt nos
- manual: fuller DPD doc; some spelling typos, formatting
2022-11-10 22:13:41 +00:00
gitlost
c0a5c7b125 manual: Deutshe -> Deutsche (#266) 2022-08-05 23:51:24 +01:00
gitlost
930f458979 backend: define z_alloca() and use for both Unix and Windows;
replace double-slash comments with old-skool slash asterisk ones;
  define uint16_t etc for Windows ourselves and remove ms_stdint.h &
  stdint_msvc.h as no longer used;
  (backend (excepting test suite) now C89 compatible)
LICENSE: move from backend to root and move COPYING to frontend, with
  copies in frontend_qt & backend_qt, so in where it applies;
  add LICENSE section from manual to root README
2022-07-14 16:01:30 +01:00
gitlost
fab7435fac Performance improvements for linear encoding and raster output
- use fixed-length string tables (mostly) instead of (char *) pointer ones
   (saves ~40K)
 - re-use C128Table for CODABLOCKF and CODE16K
   (required removal of Stop character and extra CODE16K-only entry)
 - use pointer to destination and copy (memcpy/strcpy(), bin_append_posn())
   instead of concatenating (strcat()) (mostly)
 - replace last remaining bin_append()s with bin_append_posn();
   bin_append() removed
 - add length arg to toupper() and expand() (avoids strlen())
 - change is_sane() to use table-based flags (avoids an iteration)
 - rename lookup() to is_sane_lookup() and change to check and return posns
   and use in pointer to destination loops (avoids strcat()s)
 - remove special case PHARMA in expand() (dealt with in pharma())
 - make #define SILVER/CALCIUM/TECHNETIUM/KRSET etc static strings
 - replace strchr() -> posn()
 - CODE128: populate destination once in checksum loop; re-use and export
   some more routines (c128_set_a/b/c(), c128_put_in_set()) for sharing;
   prefix defines (SHIFTA -> C128_SHIFTA etc) and existing exported routines
 - use factor XOR toggle trick in checksum calcs (avoids branch)
 - raster.c: fill out single 1-pixel row and copy using new draw_bar_line(),
   copy_bar_line() routines; similarly in buffer_plot compare previous line &
   copy if same (same technique as used to improve non-half-integer scaling,
   significant performance increase, (c) codemonkey82);
   also done for PNG (BMP/GIF/PCX/TIFF not done)
 - raster/vector/output.c: shorten "output_" prefix -> "out_";
   sync vector to other raster changes to try to keep source files similar
 - 2of5.c: prefix "c25_"
JAPANPOST: return error if input data truncated (backward incompatible)
DAFT: max chars 50 -> 100
common.c: istwodigit() -> is_twodigit()
common.c/emf.c/output.c: use some further stripf()s (MSVC6 float variations)
library.c: new check_output_args() helper
zint.h: add BARCODE_LAST marker and use in library.c
QRCODE: remove a NOLINT (requires clang-tidy-13), one remaining
CMake: separate no-optimize from ZINT_DEBUG into new ZINT_NOOPT option
2021-10-20 23:05:30 +01:00
gitlost
72eac41c34 Add compliant height, using ZINT_COMPLIANT_HEIGHT flag for back-compatibility
Rename barcode funcs to same as BARCODE_XXX name
library: barcode funcs array for dispatch, used for ZBarcode_ValidID() also
general: change is_sane() comparison to nonzero from ZINT_ERROR_INVALID_OPTION
MAILMARK: fuller error messages
CODABAR: add option to show check character in HRT
zint.h: use 0xNNNN for OR-able defines
GUI: add guard descent height reset button, add Zint version to window title,
  static get_zint_version() method, use QStringLiteral (QSL shorthand),
  use SIGNAL(toggled()), add errtxt "popup" and status bar, add icons,
  add saveAs shortcut, add main menu, context menus and actions, add help,
  reset_view() -> reset_colours(), add copy to clipboard as EMF/GIF/PNG/TIF,
  lessen triggering of update_preview(), shorten names of getters/setters,
  simplify/shorten some update_preview() logic in switch,
  CODEONE disable structapp for Version S
qzint.cpp: add on_errored signal, add missing getters, add test
2021-10-09 00:13:39 +01:00
gitlost
c0791ad85e Add Structured Append support for AZTEC, CODEONE, DATAMATRIX, DOTCODE,
GRIDMATRIX, MAXICODE, MICROPDF417, PDF417, QRCODE, ULTRA
DOTCODE: use pre-calculated generator poly coeffs in Reed-Solomon for
  performance improvement
PDF417/MICROPDF417: use common routine pdf417_initial()
GUI: code lines <= 118, shorthand widget_obj(),
  shorten calling upcean_addon_gap(), upcean_guard_descent()
various backend: var name debug -> debug_print
2021-09-28 21:42:44 +01:00
gitlost
3c1869b032 library: compat symbology 39 fix; ISBN: "X" check
WARN_FAIL_ALL: always return error: ZINT_ERROR_USES_ECI/NON_COMPLIANT
Fuller error messages; more comments zint.h
mainwindow.cpp: replace metaobject ENUM with array
  (suppresses virtual in constructor warning)
2021-07-06 19:53:31 +01:00
gitlost
52c00e59ba C25/DBAR: use new func gs1_check_digit() for common GS1 check digit calc
CODE11/CODE39/EXCODE39/CODE93/PZN/CHANNEL/VIN/DBAR/UPCEAN: fuller error messages
DATAMATRIX: look_ahead_test debug counts
DBAR: consolidate option_2 cols_per_row
CMakeLists.txt: restore -fno-var-tracking-assignments for gcc no DEBUG
overall: suppress various warnings on various configs
testcommon.c: clean-up
2021-06-27 11:47:55 +01:00
gitlost
c693482aa1 Change height and row_height array to floats; DAFT tracker ratio 2021-06-19 13:11:23 +01:00
gitlost
f3a94f0c0c C25STANDARD/C25INTER/C25IATA/C25LOGIC/C25IND: add check digit option (#216) 2021-05-17 20:04:00 +01:00
gitlost
538efd6e52 gs1_verify: 4308 no pcenc (gs1-format-spec.txt); GS1 General Spec 21.0.1 2021-01-28 23:41:54 +00:00
gitlost
f62a678d0f #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
Robin Stuart
1f57c58e0c Allow explicit bind option for ITF-14
Allows for 'printing methods that do not require printing plates' as highlighted by Adham Elrayyes (Ticket #201)
2020-07-30 10:09:17 +01:00
gitlost
2a19b883a5 UPC/EAN, ITF14: quiet zones, addongap; raster/vector: sync code, use double 2020-07-15 19:00:12 +01:00
gitlost
6242e02638 CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests 2020-06-04 18:45:25 +01:00
gitlost
bca82ecc0d libzint.so: suppress exporting INTERNAL functions to the shared library; ZINT_TEST 2019-12-19 00:37:55 +00:00
Boris Zentner
31cc0ae78a Remove spaces before EOL 2017-10-25 17:23:57 +01:00
Boris Zentner
45441a6da7 Fix mixed unix / windows EOL 2017-10-25 17:15:35 +01:00
Harald Oehlmann
f83e5b1501 Make compile with MS-VC6 2017-10-16 19:26:54 +02:00
Rodrigo Torres
4963a772db Refactor 2017-09-11 19:21:33 +01:00
Robin Stuart
1882d76b70 Update version to 2.6.1 2017-08-27 09:31:02 +01:00
Robin Stuart
608b4b9134 Audit of error codes 2017-07-27 16:01:53 +01:00
Boris Zentner
63a252a573 Remove superfluous code 2016-10-30 17:10:36 +00:00
Robin Stuart
4561a66067 Add identifiers to error messages
To ease the debug process
2016-10-28 22:40:40 +01:00
Robin Stuart
2c2200a7cb modifications for VS2015, some
additional static/const's and a few bugfixes for HanXin and DotStream.

Patch by Michael <virtual_worlds@gmx.de>
2016-09-05 22:06:50 +01:00
Robin Stuart
f17f10fa7c Replace local concat() and roundup() with C library defaults
Patch by Oxy (Michael) <virtual_worlds@gmx.de>
Ref: https://sourceforge.net/p/zint/mailman/message/34896811/
2016-03-02 21:12:38 +00:00
Robin Stuart
77cdf77690 Code format and audit, part 1
Update copyright info, remove unused code, etc.
2016-02-20 09:38:03 +00:00
Robin Stuart
2e59058615 Avoid possible confusion with Windows error code
Bugfix by Oxy Genic
Ref: https://sourceforge.net/p/zint/mailman/message/34857131/
2016-02-17 10:37:20 +00:00
Harald Oehlmann
b7b7564457 Make command line version compile with MS-VC6 and QT-Version with MS-VC8 2015-08-18 13:50:42 +02:00
oxygenic
1a7863520b license changed with permission of original copyright holders (see mailing list for details) 2013-05-16 19:26:38 +02:00
openapc
bf2dbe7494 code reworked 2012-12-29 19:37:03 +01:00
Robin Stuart
30f5b996bf Tidy up check digit function common to 2 of 5 codes.
Thanks to Ismael Luceno.
2011-03-08 09:58:48 +00:00
Robin Stuart
7da2041cfd More code cleanup
Patch 7 of 7 from "Ismael Luceno" <ismael.luceno@gmail.com>
2010-09-14 11:36:00 +01:00
hooper114
1695eae7dd Structural changes and updates from tgotic 2009-11-17 22:36:04 +00:00
hooper114
242e57f536 Minor bugfixes 2009-11-02 15:47:08 +00:00
hooper114
1ff9c0d472 Add corrections from tgotic 2009-10-06 19:03:00 +00:00
hooper114
04b9a99241 API overhaul part 1: removal of nullchar 2009-09-29 09:45:46 +00:00
hooper114
cec3babc89 Check digit corrections from Massimo 2009-07-04 20:49:17 +00:00
hooper114
cb0e4e27e8 Converted zint_symbol structure usage to a more compressed format 2009-05-31 20:33:54 +00:00
hooper114
636a18c74f Allow Unicode in SVG output text 2009-02-19 19:09:57 +00:00
hooper114
88cc19bab1 Change of e-mail address 2008-11-17 08:47:42 +00:00
hooper114
c6e035bde8 Add leading zeroes rather than fail 2008-10-13 20:29:04 +00:00