mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-22 03:05:11 -04:00
- 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
This commit is contained in:
parent
6ff485e6fa
commit
070162214b
27 changed files with 354 additions and 370 deletions
|
@ -48,9 +48,10 @@ INTERNAL int pcx_pixel_plot(struct zint_symbol *symbol, const unsigned char *pix
|
|||
int run_count;
|
||||
FILE *pcx_file;
|
||||
pcx_header_t header;
|
||||
int bytes_per_line = symbol->bitmap_width + (symbol->bitmap_width & 1); /* Must be even */
|
||||
unsigned char previous;
|
||||
const unsigned char *pb;
|
||||
const int output_to_stdout = symbol->output_options & BARCODE_STDOUT; /* Suppress gcc -fanalyzer warning */
|
||||
const int bytes_per_line = symbol->bitmap_width + (symbol->bitmap_width & 1); /* Must be even */
|
||||
unsigned char *rle_row = (unsigned char *) z_alloca(bytes_per_line);
|
||||
|
||||
rle_row[bytes_per_line - 1] = 0; /* Will remain zero if bitmap_width odd */
|
||||
|
@ -104,8 +105,7 @@ INTERNAL int pcx_pixel_plot(struct zint_symbol *symbol, const unsigned char *pix
|
|||
|
||||
fwrite(&header, sizeof(pcx_header_t), 1, pcx_file);
|
||||
|
||||
for (row = 0; row < symbol->bitmap_height; row++) {
|
||||
const unsigned char *const pb = pixelbuf + row * symbol->bitmap_width;
|
||||
for (row = 0, pb = pixelbuf; row < symbol->bitmap_height; row++, pb += symbol->bitmap_width) {
|
||||
for (colour = 0; colour < header.number_of_planes; colour++) {
|
||||
for (column = 0; column < symbol->bitmap_width; column++) {
|
||||
const unsigned char ch = pb[column];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue