summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Frost <tobi@debian.org>2016-05-18 02:19:55 (EDT)
committer Gianfranco Costamagna <costamagnagianfranco@yahoo.it>2016-05-18 02:24:28 (EDT)
commit6ba6e1287bbd875cd14095e2baf36a978d88c32e (patch)
tree24560a6a3a8585a27c3586522bd6d558179ab94e
parenteed1888ade8274b106b06a55af29ef9cd33c5917 (diff)
downloadxcftools-6ba6e1287bbd875cd14095e2baf36a978d88c32e.zip
xcftools-6ba6e1287bbd875cd14095e2baf36a978d88c32e.tar.gz
xcftools-6ba6e1287bbd875cd14095e2baf36a978d88c32e.tar.bz2
Fix libpng16 issue, png_set_filler is invalid for low bit depth gray output, from Debian
-rw-r--r--xcf2png.c5
1 files changed, 4 insertions, 1 deletions
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 ;