libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit a8a11e17b8efbaa5facf78188f04c257f36bd617
parent e80d2525a49dc806a6931cbb00f6099c241d0fe2
Author: Frederic Cambus <fred@statdns.com>
Date:   Sun, 19 Jan 2020 11:50:35 +0100

Remove unneeded gdImageColorAllocate calls in the ADF and IDF loaders.

They caused the palette to contain 17 colors, and thus the output PNG
was using a 8-bit colormap instead of a 4-bit colormap.

Diffstat:
Msrc/loaders/artworx.c | 2--
Msrc/loaders/icedraw.c | 1-
2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c @@ -58,8 +58,6 @@ ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options) (ctx->buffer[index + 2] << 2 | ctx->buffer[index + 2] >> 4)); } - gdImageColorAllocate(canvas, 0, 0, 0); - /* process ADF */ uint32_t column = 0, row = 0; uint32_t character, attribute, foreground, background; diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c @@ -104,7 +104,6 @@ ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) free(idf_buffer); return -1; } - gdImageColorAllocate(canvas, 0, 0, 0); /* process IDF palette */ for (loop = 0; loop < 16; loop++) {