ref: 0a8401741d0e42c8134701ca173a979ca040944b
parent: a079a69b7c717500850e286d68a809fb13331b0a
author: Francisco Requena <[email protected]>
date: Fri Dec 16 23:04:45 EST 2016
Fixes rgbgfx linkage issues with old libpng (pre 1.4.2)
--- a/src/gfx/makepng.c
+++ b/src/gfx/makepng.c
@@ -163,7 +163,11 @@
* Also unfortunately, this sets it at 8 bit, and I can't find any
* option to reduce to 2 or 1 bit.
*/
+#if PNG_LIBPNG_VER < 10402
+ png_set_dither(img->png, palette, colors, colors, NULL, 1);
+#else
png_set_quantize(img->png, palette, colors, colors, NULL, 1);
+#endif
if (!has_palette) {
png_set_PLTE(img->png, img->info, palette, colors);