Commit graph

1060 commits

Author SHA1 Message Date
gitlost
739a64a6ff GUI: add CLI equivalent dialog (#163); use spinboxes in Sequence dialog
and restrict sequence to max 10,000, add button icons;
   make Export dialog sizable and show every 100 results, add button icon;
   fix saving CHANNEL option, fix Export painting main window (Windows), fix
   guard descent not-resetting
 qzint: add getAsCLI(), warnLevel(), extra isStackable()/isComposite() etc
 Add ZBarcode_BarcodeName()
 manual: doc above, some fixes, tweaks
2021-11-23 19:12:48 +00:00
b'Git Lost
9d85c425f4 Merge /u/alonsoschaich/zint/ branch enable-qt-test-on-win32 into master
https://sourceforge.net/p/zint/code/merge-requests/141/
2021-11-23 13:05:37 +00:00
Schaich
1c31c92fd4 Enable the qt backend test on windows
The ```configuration``` is required by the visual studio generator to determine
whether to use a Debug or a Release setup (or a user customized one). It's
required by whatever uses that generator rather then just the GUI code.

Add instructions for the Visual Studio Project File generator to the README
and enable the test on Windows.
2021-11-23 21:51:31 +09:00
Schaich
609fbeb008 Pull addon_row_height out of the loop
The ```addon_row_height``` variable is conditionally initialized in some
branches, which also set ```addon_latch``` to one(true). Later in the loop's
body, ```addon_row_height``` is accessed if ```addon_latch``` is true.

Unlike ```addon_row_height```, ```addon_latch``` is defined outside of the
loop's body, and as it is never reset to zero, keeps it's value of one once
it has been assigned. Future iterations of the loop can therefore not branch
into the code that initializes ```addon_row_height``` and (re)assigns
```addon_latch```, and ```addon_latch``` will be true, which causes
```addon_row_height``` to be accessed without having been initialized.

On most platforms, the ```addon_row_height``` variable will always be
allocated on the same memory, while skipping the initialization causes
the value that was previously assigned to ```addon_row_height``` to
remain on that memory.

Pull the variable declaration out of the for loop's body to assure the
previous iteration's value remains there independend of compiler or
platform specific behaviour.
2021-11-23 20:04:56 +09:00
gitlost
9e4ecb638f CODE128/EAN14: fix debug printf bar spaces (not NUL-terminated) 2021-11-21 15:49:32 +00:00
gitlost
e14d9e99d5 Add HEIGHTPERROW_MODE_input mode flag (#204)
backend_qt: add encodedWidth, encodedRows
DBAR_EXPSTK: add max rows option (option_3)
CODE16K/CODE49: add min rows option (option_1)
GUI: HIBC xxx -> HIBC
2021-11-20 11:32:30 +00:00
gitlost
96cf5aa668 DATAMATRIX: re [e9b8ee] add dm_text_sp_cnt() & dm_switch_mode() to get around
exiting B256 if have less than break-even sequence of TEXT chars;
  rename some vars to be more consistent
2021-11-16 18:37:51 +00:00
gitlost
e9b8ee9c1b DATAMATRIX: some changes to dm_look_ahead_test to allow exiting from B256
other than for digits (worse for TEX 7-11 embedded in extended) and for
  returning X12/EDI at EOD - will cause changes in encodation;
  allow for GS1 GS in B256 (should never happen);
  some re-jigging of dm200encode and fiddling with dm_isXXX;
  remove some DM_DEBUG from dm_placementbit
2021-11-14 12:09:51 +00:00
gitlost
21d015a84a TELEPEN: fix stop length (14 -> 12)
reedsol.c: some performance gain by stashing generated poly logs and
  pre-checking if has a zero coeff to avoid inner loop branch
2021-11-11 13:30:58 +00:00
gitlost
6c7f3300a0 DATAMATRIX: fix mis-encoding of FNC1/GS in EDIFACT in GS1 mode
(was writing a literal ']');
  improve performance by removing use of intermediate grid array;
  DEBUG -> DM_DEBUG
2021-11-09 13:43:56 +00:00
gitlost
68566fefd2 DATAMATRIX: fix mis-encodation of X12 and EDIFACT non-encodables by
checking in main dm200encode() loop, props Alex Geller;
  prefix routines and tables with "dm_"
reedsol.c: add const to a few variables
2021-11-08 13:05:37 +00:00
gitlost
f7ad0ed1e3 raster.c: fix possible blank rows appearing in CODE16K, CODE49, PHARMA_TWO,
PDF417 & CODABLOCKF due to height/scale rounding by changing
  out_large_bar_height() to return scaled int values for raster,
  props codemonkey82 (#204)
raster/vector.c: const some vars
vector.c: rect_count, last_start_row UPC/EAN only
library.c: check for stacking symbols >= 200
2021-11-07 00:21:02 +00: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
706f021637 gs1_verify(): fix zero-length AI no data and single-digit AI checks 2021-10-28 12:05:54 +01:00
gitlost
e8bde7f4c3 ZBarcode_Version() -> ZBarcode_Version(void) 2021-10-27 19:05:57 +01:00
b'Git Lost
9c3a346dbd Merge /u/gitlost/zint/ branch perf_is_sane into master
https://sourceforge.net/p/zint/code/merge-requests/134/
2021-10-21 23:00:40 +00:00
Jeff Skaistis
1f4691fbbb Fix version number format for STRINGFILEINFO resources. 2021-10-21 15:39:46 -05:00
Jeff Skaistis
d151f29ee5 Add .rc file to Windows backend build. 2021-10-21 09:53:22 -05: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
e8b59aa696 height max 500 -> 2000 to allow for 44 row CODABLOCKF at 45X each 2021-10-18 14:05:51 +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
206ae26d20 ULTRA: add revision 2 support (based on BWIPP 2021-09-28 update)
GUI: DMATRIX: disable DMRE if SQUARE checked; ULTRA: Size/Ecc buttongroup
2021-09-29 16:25:59 +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
e8b1f7a12e raster.c: fix clang garbage value warning 2021-09-27 11:11:22 +01:00
gitlost
eb6e5daa2d raster.c: need ceilf(large_bar_height * si) to avoid zero height rows;
also improve non-half-int interpolation performance
raster/vector.c: use new stripf() func in "common.c" to workaround gcc
  32-bit float calculation variations
gs1.c: allow dummy AI "[]" if GS1NOCHECK_MODE and has data (#204);
  also add note re TPX AI 235 and terminating FNC1
Remove trailing whitespace in various files
2021-09-26 23:55:16 +01:00
gitlost
9884875fd5 GUI: fix dot size label position 2021-09-25 14:44:32 +01:00
gitlost
4284f3c578 Add output_options BARCODE_QUIET_ZONES and BARCODE_NO_QUIET_ZONES 2021-09-24 13:21:24 +01:00
gitlost
4009c86c5f UPC/EAN: Add guard_bar descent (guard_descent)
zint.h: Adjust field order to improve alignments; encoded_data 143 -> 144
2021-09-22 00:04:15 +01:00
gitlost
9bae0b86f9 - raster.c: Need ceilf(symbol->height * si) to avoid heap-buffer-overflow;
also avoid distributive multiplication with floats to lessen chances of
  platform variation (#204 ARM-Cortex crash)
- raster.c: Don't allow for text if scale < 1.0
- raster.c: Cast some indexes to (size_t) to allow for large scale
- vector.c: Check malloc()s and return ZINT_ERROR_MEMORY on fail
- raster/vector.c: various var name changes & other code fiddling
- library.c: Check that scale/height/whitespace/border are reasonable values:
  scale (0.01-100), height (0-500), whitespace_width/height (0-100),
  border_width (0-100)
- CLI: allow both e.g. '-height' and '--height' (getopt_long_only())
- gif.c: fix GIF_ZLW_PAGE_SIZE -> GIF_LZW_PAGE_SIZE
- GUI: allow whitespace/scale to 100
2021-09-20 14:56:27 +01:00
gitlost
5766b39845 gif.c: use malloc instead of alloca for LZW buffer as fails for large scale 2021-09-18 17:15:16 +01:00
gitlost
bd06400a5b CODE93: add option_2 = 1 to display check chars in HRT 2021-09-13 18:49:25 +01:00
gitlost
86c15741d8 gs1.c: Allow 0-length AI data if GS1NOCHECK_MODE, props codemonkey82 (#204) 2021-09-13 17:54:46 +01:00
gitlost
9229634826 Suppress some pedantic warnings, props codemonkey82 (#204) 2021-09-12 23:37: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
c4b7921819 library.c: error_tag(): check error_number < ZINT_ERROR on WARN_FAIL_ALL 2021-08-31 18:34:29 +01:00
gitlost
603f5931de CODE93: don't display check characters in HRT (as per standard Figure B1) 2021-08-28 20:17:26 +01:00
gitlost
bb6bb1e5ee emf.c: truncate multiplication to 3 decimal places (ticket #242) 2021-08-27 18:07:05 +01:00
gitlost
b568201574 MICROQR: some debug output, test case for ticket #241 2021-08-26 17:49:05 +01:00
gitlost
b7adbf4e5b vector: Add width to struct zint_vector_circle: fix qzint render 2021-08-23 22:54:27 +01:00
gitlost
3388f98c00 vector: Add width to struct zint_vector_circle & use for MaxiCode bullseye
**Incompatible change**
2021-08-22 13:59:01 +01:00
gitlost
67b2a9c99d RMQR: add ECI support; GUI/CLI: fix dev version test 2021-08-20 16:50:39 +01:00
gitlost
62cc9e49f5 Bump version to 2.10.0.9 (dev) 2021-08-14 16:11:25 +01:00
gitlost
71af3b530e win32/zint_cmdline_vc6/zint.rc, backend/libzint.rc: update copyright year 2021-08-11 21:46:57 +01:00
gitlost
a04a44f1e6 Update zint version to 2.10.0 2021-08-10 16:14:10 +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
4d0fff7cf5 Changelog: update 2021-08-05 18:24:51 +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
aa964ef91a emf.c: suppress clang-tidy warning 2021-07-26 15:55:34 +01:00
gitlost
3f33ed3eb9 CMakeLists.txt: cmake min required 3.13 -> 3.5 using CMAKE_REQUIRED_LIBRARIES; add ZINT_COVERAGE option
bmp/emf/ps.c: allow for foreground colour in ULTRA
bmp/gif/pcx.c: allow for BARCODE_STDOUT (fflush/fclose)
emf.c: hexagon rotation field not used; dont't use float index in font loop; Windows stdout binary mode
png.c: remove unused 8-bit; simplify libpng error handling and fclose outfile on error
ps.c: fix buffer overflow on colour_to_pscolor() CMYK
tif.c: fix BLACKISZERO indexes
CODE39: simplify check digit setting
reedsol.c: rs_uint_init_gf() log/alog tables must be zeroed
ZBarcode_Encode: debug: fix access out-of-bounds on non-NUL-terminated source if length < 10
manual.txt/zint.h: document NUL-terminated strings
tests: cover further cases for output (bmp/emf/etc), eci/gb18030/gb2312/sjis, reedsol, AZTEC, CODE39
2021-07-26 15:29:05 +01:00