summaryrefslogtreecommitdiffstats
path: root/xcf2png.c
diff options
context:
space:
mode:
Diffstat (limited to 'xcf2png.c')
-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 ;