From: kramm Date: Wed, 12 Nov 2008 10:32:10 +0000 (+0000) Subject: made palette reduction work for single images, too X-Git-Tag: release-0-9-0~859 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=abfaccab0cee8c37baaae2b1bd3bd228d97605ae;p=swftools.git made palette reduction work for single images, too --- diff --git a/lib/devices/render.c b/lib/devices/render.c index 5c84754..410c5f7 100644 --- a/lib/devices/render.c +++ b/lib/devices/render.c @@ -808,7 +808,11 @@ int render_result_save(gfxresult_t*r, const char*filename) } free(origname); } else { - writePNG(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); + if(!i->palette) { + writePNG(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); + } else { + writePalettePNG(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); + } } return 1; }