From 6ba6e1287bbd875cd14095e2baf36a978d88c32e Mon Sep 17 00:00:00 2001 From: Tobias Frost Date: Wed, 18 May 2016 02:19:55 -0400 Subject: Fix libpng16 issue, png_set_filler is invalid for low bit depth gray output, from Debian --- (limited to 'xcf2png.c') diff --git a/xcf2png.c b/xcf2png.c index 6721f3d..4afe78d 100644 --- a/xcf2png.c +++ b/xcf2png.c @@ -208,8 +208,11 @@ init_output(void) #endif break ; case PNG_COLOR_TYPE_GRAY: - png_set_filler(libpng,0,PNG_FILLER_AFTER); + { + // only supported with more than 8 bits, otherwise emit error: png_set_filler is invalid for low bit depth gray output' + if (bit_depth >= 8) png_set_filler(libpng,0,PNG_FILLER_AFTER); break ; + } case PNG_COLOR_TYPE_GRAY_ALPHA: case PNG_COLOR_TYPE_PALETTE: break ; -- cgit v0.9.1