Commit graph

264 commits

Author SHA1 Message Date
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
c4b7921819 library.c: error_tag(): check error_number < ZINT_ERROR on WARN_FAIL_ALL 2021-08-31 18:34:29 +01:00
gitlost
67b2a9c99d RMQR: add ECI support; GUI/CLI: fix dev version test 2021-08-20 16:50:39 +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
gitlost
7cc2095d3c UPCE/UPCE_CC: allow check digit (same as UPCA/UPCA_CC) so selecting composite doesn't give error
composite.c: warning wasn't been passed back
zint.h/library.c: add const to char pointer args; move func defs around a bit
2021-07-12 22:27:16 +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
368633bda4 malloc/calloc: check for NULL always (11.1.0 gcc -fanalyzer -c backend/*.c)
ZBarcode_Encode: don't reinit symbol->outfile, props Alonso Schaich
frontend/test_args: skip long filename tests on Windows, props Alonso Schaich
2021-06-29 15:43:42 +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
70801d8932 tests: VC6 compatible; plot_raster_dotty: avoid float rounding difference 2021-06-23 15:00:49 +01:00
gitlost
e5115bad07 Change height and row_height array to floats: VC6, CodeQL fixes 2021-06-20 00:05: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
ede1234b8f Re MR #121 calcium -> static; reinstate STATIC_UNLESS_ZINT_TEST error_tag/strip_bom; whitespace 2021-06-10 16:20:14 +01:00
Schaich
afea0ad2c3 Get test_library compiled on windows
test_file_unreadable cannot be implemented easily, as files are always
readable by their owner on windows. While `_chmod` is available in the POSIX
compatibility function set, it cannot be used to take away read permissions,
either.

While here, move functional code out of any assert statements. It shall be
executed even when the assertions are disabled
2021-06-10 21:00:42 +09:00
gitlost
4a8cac2a5a CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs
PLESSEY: add options NCR weighted mod-10, hide check digit(s) in HRT
test suite: now runnable under MSVC 2019, 2017, 2015, MinGW/MSYS
win32/README: update with MSVC 2019 and CMake instructions
2021-06-10 11:15:39 +01:00
gitlost
dfb9345b75 png: ULTRA: allow for fgcolour if bind/box, bug introduced by [ed3cc5] (MR #111) 2021-05-28 14:37:57 +01:00
gitlost
79d3c1dc7a Add GS1PARENS_MODE (input_mode) to allow inputting GS1 AIs in parentheses 2021-05-15 12:23:46 +01:00
gitlost
2d962c6321 get_best_eci: check UTF-8 before returning 26; move is_valid_utf8 to common 2021-03-21 17:35:52 +00:00
gitlost
6274140c73 CODEONE: various fixes, ECI support; #209 2021-02-05 23:55:24 +00:00
gitlost
f6bed3acb2 DOTCODE: Fix best_mask -> high_score prime test; manual mask 2021-01-22 18:07:59 +00:00
gitlost
484bd6e19a CLI: Handle UTF-8 args on Windows; -b <barcode name> 2021-01-20 21:15:03 +00:00
gitlost
f9300cb37e gs1_verify: validate AIs from BWIPP gs1-format-spec.txt 2021-01-18 20:10:52 +00:00
gitlost
0b80592f87 escape_char_process: "\xNN" simple convert (reverts [dddf29]), "\uNNNN" BMP check 2021-01-15 14:22:32 +00:00
gitlost
b999c11414 library: strip_bom: copy NUL; error_tag: defensively truncate, return error 2021-01-12 19:51:54 +00:00
gitlost
7fe930b4dc eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
gitlost
f62a678d0f #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
gitlost
bee5f08f50 #209 rss.c, composite.c; DBAR_EXP encodation methods; symbol NO_PNG out.gif 2020-12-21 19:30:07 +00:00
gitlost
f09826b9a4 ZBarcode_Encode_File: suppress gcc -fanalyzer warning, props Andre Maute; ZINT_MAX_FILE_LEN 2020-12-18 02:36:48 +00:00
gitlost
cd214addba HANXIN: 0xFFE terminator; reedsol/AZTEC: stack-based; AZTEC/HANXIN/QR/GRIDMATRIX speedups; #209 2020-11-27 12:54:44 +00:00
gitlost
44923349f3 PDF417/raster: performance large data; common.h inline, module_colour_is_set(); #209 2020-11-01 18:32:55 +00:00
gitlost
943ba79866 AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
gitlost
36c19053d7 vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
gitlost
ac7b5dd282 #206 build: version to 2.9.1.9; ZINT_VERSION_BUILD (9 dev); tools/update_version.php 2020-09-04 16:38:11 +01:00
gitlost
caf46ed69b #205 library: Make dpd_parcel() signature consistent, props Pierre Y. 2020-09-03 16:36:57 +01:00
Robin Stuart
9f5ae4cbb2 First stage at creating ZPL compatability mode
Partly resolves #142 and relates to discussion in #197
2020-08-22 11:09:57 +01:00
gitlost
736bc76f66 command line: allow data/input args anywhere on line; frontend tests 2020-08-04 22:22:26 +01:00
Robin Stuart
04f6f81e68 Accept input of escaped 16-bit Unicode characters 2020-08-04 11:48:43 +01:00
Robin Stuart
13f4a3547d New symbology: DPD Code (variation of Code 128) 2020-08-03 12:13:05 +01:00
Robin Stuart
47cac63e7f Add alpha channel support and --nobackground option
Alpha channel for PNG and SVG and option to remove background from EMF
2020-08-02 22:26:39 +01:00
Robin Stuart
e9652df70c Change PDF417TRUNC -> PDF417COMP and version 2.8 -> 2.9 2020-07-29 22:35:31 +01:00
Robin Stuart
0004cfb35a Change symbol names e.g. RSS > GS-1 DataBar
Preserves old names in zint.h to retain backwards compatability.
2020-07-29 20:43:08 +01:00
gitlost
dd2bdb4335 CODE128: hrt always UTF-8; CODE128/EXCODE39/CODE93: blank same NUL/ctrl/DEL chars 2020-07-19 00:13:03 +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
7be63a00b6 CODE16K fixes; separator default 1; raster/vector.c quiet_zones, output.c; #191 2020-05-21 18:22:28 +01:00
gitlost
8dcd09406c CODABLOCKF and CODE128 fixes; row separator height option_3; #191 2020-05-16 10:22:33 +01:00
Robin Stuart
92cfd65b56 Allow GS1 mode in Ultracode symbols 2020-04-07 17:41:21 +01:00
gitlost
0c00ece9f5 #181 OSS-Fuzz CODEONE fix, double indexing typo 2020-03-28 10:13:06 +00:00
gitlost
0f5deccfb6 #181 OSS-Fuzz ZBarcode_Encode_File fix, allow for zero-length file, free buffer on error 2020-03-26 22:17:37 +00:00
gitlost
b00b227b4f PDF417 no longer uses option_3 for no. codewords so set default 0 & remove from Studio 2019-12-19 20:29:11 +00:00
gitlost
bca82ecc0d libzint.so: suppress exporting INTERNAL functions to the shared library; ZINT_TEST 2019-12-19 00:37:55 +00:00
Robin Stuart
8295883987 Merge rMQR support in to master 2019-12-01 15:17:08 +00:00
Robin Stuart
f9d969cdd6 Remove depreciated gLabels render code 2019-12-01 14:09:46 +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
ad28de1819 Initial implementation of rMQR
According to draft dated June 2018
2019-11-25 19:08:25 +00:00
gitlost
739793a215 Always parse input as GS1 for EAN128 and RSS_EXP 2019-10-17 10:06:21 +01:00
gitlost
433046abbf KOREAPOST missing from is_linear; tests update 2019-10-14 09:49:15 +01: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
ff2ceea361 Allow selection of GS1 mode on GS1 symbols
Because some symbols require GS1 data, selecting GS1 mode for them would result in GS1 parsing being done twice, corrupting the data.
Fixes #165 reported by Gregory Van Vooren
2019-10-06 11:30:21 +01:00
Robin Stuart
faeb20dcd7 Don't stretch PDF unless expressly requested by user
Now default height is 50 only for linear symbols and those with linear component (such as GS1 composite)
Restores default behaviour changed by commit [f2262f]
2019-09-04 21:57:54 +01:00
gitlost
d76cdd615b Fixes for eci, binary div, upce, other 2019-09-01 20:23:15 +01:00
Robin Stuart
ca24105ca0 Add placeholder for Ultracode 2019-03-21 09:14:24 +00:00
Robin Stuart
1debb132af Revert last change
This functionality already exists - note to self: read code thoroughly before committing
2019-03-18 19:36:03 +00:00
Robin Stuart
b531abf9b4 Try to protect from malformed colours 2019-03-18 17:36:36 +00:00
Robin Stuart
656c8132a8 Use internal vector format in Qt backend 2018-06-18 02:36:40 +01:00
Robin Stuart
30fcd7986c Plot vector graphics using linked list structure
Simplifies the implementation of individual vector graphic file formats
2018-06-10 09:16:18 +01:00
Robin Stuart
dddf2934fc Allow escape character processing
Fixes #101 reported by Martin Zizka
Converts \xNN characters > 0x7c to UTF-8 if appropriate
Removes some redundant legacy code
2018-04-22 14:25:39 +01:00
Robin Stuart
e6618f1a1b Allow escape character processing in batch mode
Suggested by Martin Zizka, Fixes #96
2018-03-30 11:40:44 +01:00
Robin Stuart
78d85bd72e Add font size option for SVG and EPS 2018-02-11 09:55:28 +00:00
Robin Stuart
59116f689d Add new symbology: Royal Mail Mailmark 2018-02-06 20:57:01 +00:00
Robin Stuart
e737f992b5 Add verification for North America VIN (Vehicle Identification Number) 2018-02-03 18:44:01 +00:00
Robin Stuart
0d4af7a462 Resolve further error message and warning idiosyncrasies 2018-01-21 18:10:42 +00:00
Robin Stuart
d2161ffb20 Make CLI errors more consistent
Should now output errors and warnings in a consistent and predictable fashion. This is not a neat solution, but functional for now.
2018-01-21 14:33:54 +00:00
Harald Oehlmann
7cb5eec35a Fix -esc crash for windows 2018-01-14 17:47:02 +01:00
Robin Stuart
782a3a6f39 Include terminator in esc processed string
Attempts to fix #89 reported by Matt Johnson
2018-01-13 15:45:26 +00:00
Robin Stuart
670000b7ea Improve wording of error 227
Fixes #87 reported by Ken Yap
2017-12-24 14:51:12 +00:00
Robin Stuart
58537edf0a Remove debug message 2017-11-05 14:32:42 +00:00
Robin Stuart
ddce98a1bb Correct processing of escape char mode 2017-11-05 14:27:01 +00:00
Boris Zentner
31cc0ae78a Remove spaces before EOL 2017-10-25 17:23:57 +01:00
Robin Stuart
29dbb49325 Add escape sequence support to GUI
Also ensures that CR/LF formatted files remain unaltered when importing
Fixes #72 reported by Siniša Sudec
2017-10-22 10:55:50 +01:00
Robin Stuart
0314ca65a8 Move escape character processing into library
And expand to include all 8-bit values.
2017-10-21 12:45:50 +01:00
Jojakim Stahl
3bbc188217 Fixed bug introduced in bfb183e5df with utf8 input be trucated at length - 3 2017-10-18 11:40:20 +02:00
Jojakim Stahl
c7d6256a6e Free symbol->rendered structures on ZBarcode_Clear and repeated calls of ZBarcode_Render 2017-10-18 11:40:19 +02:00
Robin Stuart
bfb183e5df Strip BOM from Unicode input data
Fixes #76, reported by Shmupsik
2017-10-09 19:59:02 +01:00
Rodrigo Torres
4963a772db Refactor 2017-09-11 19:21:33 +01:00
Robin Stuart
608b4b9134 Audit of error codes 2017-07-27 16:01:53 +01:00
Robin Stuart
e81a90bb58 Avoid SIGSEGV on Code 128 input too long 2017-07-26 11:44:47 +01:00
oxygenic
d8330f5d96 back-merged 2017-07-24 13:44:27 +01:00
Robin Stuart
8ca1329fcf Allow ECI 26 in Unicode mode 2017-07-23 18:04:58 +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
0d6716a773 Add method for dynamically checking version info
Suggestion by aragon@phat.za.net for python-zint
2017-07-01 09:06:47 +01:00
Robin Stuart
6306228fed Remove unnecessary debug code 2017-06-18 13:03:25 +01:00
Robin Stuart
a085bca168 Revion of ECI number encoding 2017-06-18 13:00:22 +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
b426877a4f Add new symbology UPNQR 2017-05-20 23:37:50 +01:00
Robin Stuart
19ba8a34c4 Update to version 2.6.0 and update copyright to 2017 2017-05-11 21:14:38 +01:00
Robin Stuart
6f4610aa98 Add verbose mode to output debug info without recompiling 2017-04-11 10:05:38 +01:00
Robin Stuart
ec8cfcbb76 Add TIFF output option 2016-12-30 20:25:58 +00:00
Robin Stuart
d1e406b7d2 Add enhanced metafile format (EMF) support 2016-12-23 16:48:03 +00:00
Boris Zentner
8851884ea1 Clear symbol->text without a constant. 2016-10-30 17:41:56 +00:00