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:
+18
-4
@@ -222,7 +222,6 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
|
||||
struct filemem *const fmp = &fm;
|
||||
const unsigned char *pb;
|
||||
int compression = TIF_NO_COMPRESSION;
|
||||
long file_pos;
|
||||
const int output_to_stdout = symbol->output_options & BARCODE_STDOUT;
|
||||
uint32_t *strip_offset;
|
||||
uint32_t *strip_bytes;
|
||||
@@ -497,12 +496,23 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
|
||||
/* End of strip */
|
||||
if (compression == TIF_LZW) {
|
||||
#ifndef NDEBUG
|
||||
file_pos = zint_fm_tell(fmp);
|
||||
long before_file_pos, after_file_pos;
|
||||
if ((before_file_pos = zint_fm_tell(fmp)) == -1L) {
|
||||
(void) zint_fm_close(fmp, symbol);
|
||||
return z_errtxt(ZINT_ERROR_FILE_WRITE, symbol, 671, "Failed to get file position in TIF output");
|
||||
}
|
||||
#endif
|
||||
|
||||
bytes_put = tif_lzw_compress(fmp, strip_buf, bytes_put);
|
||||
|
||||
#ifndef NDEBUG
|
||||
assert(bytes_put == (unsigned int) (zint_fm_tell(fmp) - file_pos));
|
||||
if ((after_file_pos = zint_fm_tell(fmp)) == -1L) {
|
||||
(void) zint_fm_close(fmp, symbol);
|
||||
return z_errtxt(ZINT_ERROR_FILE_WRITE, symbol, 673, "Failed to get file position in TIF output");
|
||||
}
|
||||
assert(bytes_put == (unsigned int) (after_file_pos - before_file_pos));
|
||||
#endif
|
||||
|
||||
if (bytes_put != strip_bytes[strip]) {
|
||||
const int diff = bytes_put - strip_bytes[strip];
|
||||
strip_bytes[strip] = bytes_put;
|
||||
@@ -528,7 +538,11 @@ INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, const unsigned char
|
||||
}
|
||||
|
||||
if (compression == TIF_LZW) {
|
||||
file_pos = zint_fm_tell(fmp);
|
||||
long file_pos;
|
||||
if ((file_pos = zint_fm_tell(fmp)) == -1L) {
|
||||
(void) zint_fm_close(fmp, symbol);
|
||||
return z_errtxt(ZINT_ERROR_FILE_WRITE, symbol, 675, "Failed to get file position in TIF output");
|
||||
}
|
||||
zint_fm_seek(fmp, 4, SEEK_SET);
|
||||
free_memory = file_pos;
|
||||
temp32 = (uint32_t) free_memory;
|
||||
|
||||
Reference in New Issue
Block a user