made palette reduction work for single images, too
authorkramm <kramm>
Wed, 12 Nov 2008 10:32:10 +0000 (10:32 +0000)
committerkramm <kramm>
Wed, 12 Nov 2008 10:32:10 +0000 (10:32 +0000)
lib/devices/render.c

index 5c84754..410c5f7 100644 (file)
@@ -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;
 }