Commit graph

30 commits

Author SHA1 Message Date
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
98f86727cc Add BARCODE_MEMORY_FILE to symbol->output_options to allow
outputting to in-memory buffer `symbol->memfile` instead of to
  file `symbol->outfile`, ticket #301
Add "README.clang-tidy" and ".clang-tidy" options file
Suppress some warnings
2023-12-27 19:20:19 +00:00
gitlost
070162214b - raster/BMP/GIF/PCX/TIF: fix dealing with very large data (use
`size_t` as appropriate)
- BMP: lessen heap memory usage by only `malloc()`ing a row, not
  whole file
- GIF: lessen heap memory usage by paging (also simplifies some
  function returns); use standard colour char map
- raster: add `raster_malloc()` to fail > 1GB (avoids very large
  output files that most systems can't handle; also lessens to
  some degree chances of being victim of OOM killer on Linux)
- GUI: printing scale dialog: set maxima on X-dim and resolution
  to keep scale <= 200
2023-12-22 21:29:54 +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
ab2abccdb6 - zint_symbol->fgcolour & bgcolour buffer lengths extended 10
-> 16 to allow for "C,M,Y,K" comma-separated decimal percentage
  strings
- API/CLI/GUI: allow foreground/background colours to be specified
  as comma-separated decimal "C,M,Y,K" strings where "C", "M" etc.
  are percentages (0-100) (ticket #281, 3rd point)
- output.c: new funcs `out_colour_get_rgb()` & `out_colour_get_cmyk()`
  and use in bmp/emf/gif etc.
- PCX: add alpha support
- GUI: fix fg/gbcolor icon background not being reset on zap
- GUI: Rearrange some Appearance tab inputs (Border Type <-> Width,
  Show Text <-> Font, Text/Font <-> Printing Scale/Size) to flow
  more naturally (hopefully)
- GUI: save button "Save As..." -> "Save..." and add icon
- CLI: add --bgcolor/colour & --fgcolor/colour synonyms
2023-01-29 19:51:11 +00:00
gitlost
268fdd7fc2 - BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT: check for errors on writing
to output file; ZBarcode_Encode_File: check `fseek()` for errors
  (ticket #275)
- man page: fix Code 11 check digit info
- manual/man page: document octal escape; Code 128 subset/mode ->
  Code Set
2022-12-19 16:28:15 +00: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
a6cc4f5203 backend: standard lib includes before local (fixes [[e1522e]]) 2022-09-13 22:08:08 +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
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
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
44923349f3 PDF417/raster: performance large data; common.h inline, module_colour_is_set(); #209 2020-11-01 18:32:55 +00:00
gitlost
129fa81c41 Fix PCX issue with odd bitmap width; tests; comment GRIDMATRIX byte count 2020-04-06 21:26:13 +01:00
Robin Stuart
0d26948baa Merge branch Ultra 2020-04-06 17:05:22 +01:00
Robin Stuart
5861ad3c3b Ultra: Extend colour support to PNG PCX BMP and TIF
Implementation needs improvement, but colour output is now achieved in most formats
2020-01-06 20:01:48 +00: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
Robin Stuart
608b4b9134 Audit of error codes 2017-07-27 16:01:53 +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
5992bbf6e5 Malloc declaration needed for Visual Studio 2016-11-05 16:46:24 +00:00
Robin Stuart
184fb71fe5 [PATCH] Remove non standard #include <malloc.h> 2016-10-30 17:43:10 +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
e0402ba434 Consolidate raster image rotation and colour sanity checks 2016-09-11 08:42:31 +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
3cf8a142b8 Bugfix: Ouput binding in raster images
Also: tidy up use of output_options
2016-08-26 15:13:40 +01:00
Harald Oehlmann
3939a1ae54 Make compile with MSVC6 (no C99 compatibility) 2016-07-28 10:32:46 +02:00
Robin Stuart
b968073d71 --typo 2016-07-23 19:17:53 +01:00
Robin Stuart
7eaa82bfa1 Improved PCX algorithm, uses less memory 2016-07-23 19:14:57 +01:00
Robin Stuart
babeaec41d Add ZSoft PCX image file output 2016-07-23 15:08:55 +01:00