From abfaccab0cee8c37baaae2b1bd3bd228d97605ae Mon Sep 17 00:00:00 2001 From: kramm Date: Wed, 12 Nov 2008 10:32:10 +0000 Subject: [PATCH] made palette reduction work for single images, too --- lib/devices/render.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 1.7.10.4