Commit graph

63 commits

Author SHA1 Message Date
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
607e4ed33a EAN/UPC: add quiet zone indicators option (API output_options
`EANUPC_GUARD_WHITESPACE`, CLI `--guardwhitespace`) (ticket #287)
EAN-2/EAN-5: HRT now at top instead of at bottom for standalones,
  following BWIPP
CLI: batch mode: don't close input if stdin
EAN/UPC: fix excess 1X to right of add-ons
Composites: fix excess whitespace; fix quiet zone calcs to allow
  for linear shifting
CLI: use own (Wine) version of `CommandLineToArgvW()` to avoid
  loading "shell32.dll"
Move "font.h" -> "raster_font.h"
EPS/SVG: use new `out_putsf()` func to output floats, avoiding
  trailing zeroes & locale dependency
EPS: simplify "TR" formula
SVG: change font from "Helvetica, sans serif" to "OCR-B, monospace";
  use single "<path>" instead of multiple "<rect>"s to draw boxes
  (reduces file size)
Add `EMBED_VECTOR_FONT` to `output_options` (CLI `--embedfont`) to
  enable embedding of font in vector output - currently only for
  SVG output of EAN/UPC
GUI: use "OCR-B" font for EAN/UPC and "Arimo" for all others (was
  "Helvetica" for both); paint background of screen preview light
  grey so as contrasts with whitespace and quiet zones
EMF: prefix funcs with `emf_`; simplify string `halign` handling
large: rename `large_int` -> `large_uint`
CODE128/common: move `c128_hrt_cpy_iso8859_1()` to
  `hrt_cpy_iso8859_1()` and add `ZINT_WARN_HRT_TRUNCATED` warning
  (for future use)
Various symbologies: replace `printf()` with `fputs()`
  (symbol->debug)
QRCODE: better assert(), removing a NOLINT (2 left)
CLI: add some more barcode synonyms for DBAR
common: various fiddlings
CMake: don't include png.c unless ZINT_USE_PNG (avoids clang
  warning)
2023-06-12 01:25:55 +01:00
gitlost
e515f63fab - PDF417/MICROPDF417: use latch not ps shift for padding when
spanning Text segments to avoid affecting 1st char of 2nd segment
- PDF417/MICROPDF417: add optimized encoding, FAST_MODE for
  previous scheme; formatting changes
- common.c/h: add `cnt_digits()`, comments in include and make more
  consistent, minor code fiddling
- DOTCODE: replace `dc_n_digits()` with new `cnt_digits()`
- test_qr: fix `test_qr_perf()`
- composite: minor code fiddling
- library: debug dump HIBC-processed input
- BWIPP: update to latest
2022-11-06 22:25:19 +00:00
gitlost
92a4a25ed2 - DOTCODE, QRCODE, RMQR: return warning if ECI or Structured Append used in
GS1 mode, ticket #271
- CLI: improve `getopt_long_only()` processing, printing own message if bad
  arg and returning error if so rather than continuing to process
- manual: MSE typo -> MSI, a few other changes; adjust SVG scaling for PDF
  manual; pandoc 2.19.2
2022-09-28 21:58:57 +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
0b3fe8db93 GUI: remove sizeConstraint so squashable again (sigh)
- make Sequence Format textbox bigger (on own line)
  - suppress question mark in Windows dialogs
AUSPOST: more standard error messages
backend: add & use z_isdigit/upper/lower() macros
docs: 20-bit Unicode -> 21-bit Unicode
2022-06-24 14:38:48 +01:00
gitlost
15b8024712 - library: check symbol->primary for escape sequences also
- GUI: error message GS1_MODE -> GS1 mode
- GUI: sequence window: fix initial clear button status
- GUI: make acceptable for macOS; add iconset for macOS, install
- manual: update macOS Homebrew install info; add README.macos
- GUI: export window: add no. of sequences to results label
2022-06-16 16:47:34 +01:00
gitlost
f58c80e290 Add multiple segments support for AZTEC, CODEONE, DATAMATRIX, DOTCODE,
GRIDMATRIX, HANXIN, MAXICODE, MICROPDF417, PDF417, QRCODE, RMQR, ULTRA
RMQR: fix ECI encoding (wrong bit length for indicator)
MICROQR: check versions M1 and M2 for allowed characters so as to give
  better error messages
DOTCODE: some small optimizations
common.c: add is_chr(), segs_length(), segs_cpy()
CODEONE/CODE128/DOTCODE/GRIDMATRIX/HANXIN/MAXICODE/QRCODE/ULTRA: add
  namespace prefixes to static funcs/data
includes: use Z_ prefix, unuse double underscore prefixes (guard defines)
manual.txt: compress some tables using double/treble column sets
2022-05-09 19:50:50 +01:00
gitlost
4e72a541f7 PDF417: fix cols/rows calculation to require multiple <= 928 codewords;
add specify rows option (option_3) (#204);
  warn if cols increased from specified (back-incompatible);
  move table definitions from "pdf417.h" to new "pdf417_tabs.h" and
  make INTERNAL_DATA and share with composite.c (saves ~10K);
  prefix routines and tables with "pdf_";
  some small performance improvements through if/elses, pdf_textprocess()
  & pdf_numbprocess() loop simplifications
MICROQR: fix debug access crash on printing non-NUL-terminating binary
DATAMATRIX: fix missing ++ from "[tp]" at C40/TEXT EOD processing of GS1
  (though probably never reached); use "[tp++]" throughout
Add const to static tables missing it and also to some variables
Change "debug" -> "debug_print" throughout
2021-10-30 22:00:31 +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
14c236644f Structured Append: fix DOTCODE codeword length allowance; manual.txt fixes 2021-09-29 15:06:33 +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
f84f82d9a2 GUI: Separate out SCM fields for MAXICODE (Ticket #212)
vector.c: Enforce minimum scale 0.1 and allow down to 0.1 in GUI
2021-09-09 21:50:02 +01:00
gitlost
14d1140d09 CODABLOCKF: prevent cols > 62; fix pTestList buffer overflow
RMQR: update to new draft ISO/IEC JTC1/SC31N000 (Draft 2019-6-24);
  allow for righthand vertical timing pattern in populate_grid()
ULTRA: update max size and min cols based on BWIPP 2021-07-14 update
backend_tcl/zint_tcl.dsp: use /MD instead of /MT for tcl lib compat;
  change include/lib path to more standard one
manual.txt: highlight that rMQR is still in development
GUI: use cross-platform smaller font func instead of explicit values for notes
2021-08-10 12:04:25 +01:00
gitlost
b015e38da0 composite: fix buffer overflow for large linear, small composite (500 -> 1000)
composite: clear errtxt when bumping from CC-A -> CC-B -> CC-C
composite: CC-C adjustment 53 -> 52 (same as BWIPP) with proper explanation
composite: remove unneeded > 11805 length check
CODEONE: remove unneeded extended ASCII check in C40 count
GS1_128/CODE16K: remove unneeded initial GS1 mode '[' check
PDF417: remove unneeded second option_2 > 30 check
Document some "Not reached" lines (code coverage)
Update bwipp_dump.ps
GUI: window/tab height +5 so 2 full lines for composite edit box (Ubuntu)
manual: dash -> hyphen, PDF417 "check digit" -> "error correction", DMRE ref
tests: further test cases for CODEONE/CODE16K/common/composite/DATAMATRIX/
DOTCODE/gs1/MAXICODE/PDF417/postal/QRCODE
2021-08-05 16:34:45 +01:00
gitlost
c693482aa1 Change height and row_height array to floats; DAFT tracker ratio 2021-06-19 13:11:23 +01:00
gitlost
9b63e2ae22 DOTCODE: allow for max 200 cols in CLI, GUI, Tcl; more detailed size error messages 2021-05-28 15:05:06 +01:00
gitlost
f6bed3acb2 DOTCODE: Fix best_mask -> high_score prime test; manual mask 2021-01-22 18:07:59 +00:00
gitlost
f62a678d0f #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
gitlost
52d08fd9b9 #191 clang-tidy reduce NOLINTs using asserts, remove DeadStores 2020-07-19 10:31:12 +01:00
gitlost
3bda3b6213 DOTCODE: score_array Rev 4; initial HT/FS/GS/RS, macro fixes; CR/LF; #191 clang-tidy warnings; gs1 DEL 2020-05-02 00:38:35 +01:00
gitlost
5d60d67a84 emf free malloc bufs; tif don't free alloca bufs (Win); -Wextra; tests 2020-04-04 16:53:29 +01:00
gitlost
f5149990eb #181 OSS-Fuzz DOTCODE codeword_array buffer overrun fix 2020-03-31 13:02:53 +01:00
Robin Stuart
53d5187853 Dotcode: correct encoding of HT/FS/GS/RS when shifting to code set B
Also updated references to specification annex to match latest version
Bug reported by Nico Gunkel as part of #181
2020-03-28 15:28:11 +00:00
gitlost
bee8794cda #181 OSS-Fuzz DOTCODE fix, check length before accessing in binary() 2020-03-25 22:31:59 +00:00
Robin Stuart
2faff4e76f Correct ECI but in DotCode
Avoid creating codewords > 112
Fixes #174 reported by Milton Neal
2019-12-26 17:57:29 +00:00
gitlost
bca82ecc0d libzint.so: suppress exporting INTERNAL functions to the shared library; ZINT_TEST 2019-12-19 00:37:55 +00:00
gitlost
fed7378675 Handle UNICODE_MODE ECI conversion for reduced charset barcodes and QRCODE/MICROQR 2019-11-27 16:16:14 +00:00
Robin Stuart
1a5eb573cf Minor Dotcode tweaks
Slight modification brings code inline with latest version of draft standard.
Thanks to input from Terry Burton at BWIPP
2019-10-31 13:27:36 +00:00
Robin Stuart
15ae99ee11 Allow explicit ECI 3
Setting ECI to 3 now causes Zint to include ECI 3 in symbol, and allows entry of data formatted in ISO 8859_1
Fixes #127 requested by Harald Oehlmann
2019-10-06 17:39:54 +01:00
Robin Stuart
91d933adb7 Select symbol with unforced corners if none meets threshold 2018-06-20 00:40:36 +01:00
Robin Stuart
053c83d036 Implement new mask grading with forced corners in Dot Code 2018-06-20 00:10:30 +01:00
Boris Zentner
31cc0ae78a Remove spaces before EOL 2017-10-25 17:23:57 +01:00
Robin Stuart
4c1c180fbf Protect DotCode from dimensions smaller than 5 2017-09-30 17:14:45 +01:00
Rodrigo Torres
4963a772db Refactor 2017-09-11 19:21:33 +01:00
Robin Stuart
1ca01e9322 Make data types for tables consistent across symbologies
..and reduce library binary size slightly
2017-08-09 09:13:37 +01:00
Robin Stuart
608b4b9134 Audit of error codes 2017-07-27 16:01:53 +01:00
oxygenic
d8330f5d96 back-merged 2017-07-24 13:44:27 +01:00
Robin Stuart
451f0150d8 Expand ECI support and enforce binary mode when ECI is set 2017-07-23 17:59:51 +01:00
Robin Stuart
b3a1b24d18 help the compiler create more efficient code
Patch from Michael <virtual_worlds@gmx.de>
Full text: As usual I have modified only minor things to remove warnigs when compiled as C++ code, have added some const-specifiers where possible to help the compiler create more efficient code and added some static-specifiers to make functions invisible to other modules.
2017-05-29 10:43:47 +01:00
Robin Stuart
847fa6f332 Update DotCode to latest draft (April 24, 2017) 2017-05-19 21:30:31 +01:00
Robin Stuart
19c3755ed0 Simplify conversion to binary with common function
No change to functionality
2017-05-14 08:15:08 +01:00
Robin Stuart
6f4610aa98 Add verbose mode to output debug info without recompiling 2017-04-11 10:05:38 +01:00
Harald Oehlmann
480e514754 Make bakcend/dotcode.c, emf.c and tif.c compile with MS-VC6 2017-03-28 18:06:08 +02:00
Robin Stuart
cddf469ac6 Allow encoding HT FS GS RS and CRLF in code set B
Bug reported by Milton Neil <miltonneal@bigpond.com>
2017-02-19 00:09:24 +00:00
Robin Stuart
6a69e97dfe Improved pad character handling routine
Bugfix and code by Milton Neil <miltonneal@bigpond.com>
2017-02-18 22:17:49 +00:00
Robin Stuart
025a485ddf Pad only with character 109 when finishing in binary mode
Bug report by Milton Neil
2017-02-14 18:01:48 +00:00
Robin Stuart
a77e448df5 Correctly determine symbol size accoding to section 5.2.2
Bug fix by Milton Neil <miltonneal@bigpond.com>
2017-02-14 11:04:58 +00:00
Robin Stuart
ecb10e6b7d Don't initialise roots beyond end of field
AKA don't use code from draft standards without testing it!
Bug reported by Christian Sakowski
2017-01-22 19:12:11 +00:00
Robin Stuart
4561a66067 Add identifiers to error messages
To ease the debug process
2016-10-28 22:40:40 +01:00