mirror of
https://git.code.sf.net/p/zint/code
synced 2026-07-31 10:29:52 +00:00
CLI: make --mirror available in standard non-batch mode via
new routines `mirror_start()`, `mirror_outfile()` & limit substitutions on Unix to backslash (Windows remains the same); restrict "borderwidth", "textgap", "vwhitesp", "whitesp" < 100 CODEONE: fix `ceilf()` -> `C1_MULT_CEIL()` in FAST_MODE encodation (improves/changes some encodation) composite: preserve `gs1_verify()` warning using `warn_level` hack; fix wrong name `zint_dbar_omnstk_set_height()` -> `zint_dbar_stk_set_height()`; use new `zint_micropdf_variant()` & `zint_micropdf_expand()` routines (see below) MICROPDF417: move variant determination into new shareable routine `zint_micropdf_variant()` & expansion into `zint_micropdf_expand()` qzint: add helper methods `setbordertypevalue()`, `encodedinputmode()`, `encodedoutputoptions()`, `ecivaluetoeciindex()` and `eciindextoecivalue()` dbar: for performance pre-calculate `combins()` as array coverage: add `malloc()`-type failure testing to AZTEC, CONTENT_SEGS, MEMORY_FILE, raster, Reed-Solomon & vector; numerous changes to remove unused code and test more branches common: add `isxdigit()` general: various code fiddlings manual: add char names to sequence and batch format char tables; mention long options can be shortened (& use "--compliantheight" -> "--compliant"); expand mirror explanation & document substitutions in footnote; workaround xecjk putting space after double quote when quoting cjk chars & rejig input mode examples; workaround html alignment bug in table gs1-enabled symbologies by adding extra rh dashes to header cols; add "figure nn: " to txt image tags via sed: various other small fixes and rephrasings
This commit is contained in:
+6
-9
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include "common.h"
|
||||
@@ -163,14 +164,14 @@ static int gif_NextCode(struct gif_state *pState, unsigned char *pPixelValueCur,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int gif_lzw(struct gif_state *pState, unsigned char paletteBitSize) {
|
||||
static void gif_lzw(struct gif_state *pState, unsigned char paletteBitSize) {
|
||||
unsigned char PixelValueCur;
|
||||
unsigned char CodeBits;
|
||||
unsigned short Pos;
|
||||
|
||||
assert(pState->pIn != pState->pInEnd);
|
||||
|
||||
/* > Get first data byte */
|
||||
if (pState->pIn == pState->pInEnd)
|
||||
return 0;
|
||||
PixelValueCur = pState->map[*pState->pIn++];
|
||||
/* Number of bits per data item (=pixel)
|
||||
* We need at least a value of 2, otherwise the cc and eoi code consumes
|
||||
@@ -217,7 +218,7 @@ static int gif_lzw(struct gif_state *pState, unsigned char paletteBitSize) {
|
||||
= (unsigned char) (pState->OutPosCur - pState->OutByteCountPos - 1);
|
||||
}
|
||||
pState->OutPosCur++;
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
/* Check for currently last code */
|
||||
if (pState->FreeCode == (1U << CodeBits))
|
||||
@@ -444,11 +445,7 @@ INTERNAL int zint_gif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixe
|
||||
zint_fm_write(outbuf, 1, 10, State.fmp);
|
||||
|
||||
/* Call lzw encoding */
|
||||
if (!gif_lzw(&State, paletteBitSize)) {
|
||||
free(State.pOut);
|
||||
(void) zint_fm_close(State.fmp, symbol);
|
||||
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 613, "Insufficient memory for GIF LZW buffer");
|
||||
}
|
||||
gif_lzw(&State, paletteBitSize);
|
||||
zint_fm_write(State.pOut, 1, State.OutPosCur, State.fmp);
|
||||
free(State.pOut);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user