From 734576e6be5ace1eb1064a95d3d25fb783ed237e Mon Sep 17 00:00:00 2001 From: Patrick Boettcher Date: Wed, 15 Jun 2016 10:36:39 +0200 Subject: [PATCH] image-write: fix monochrome bitmap writing from 8-bit-buffers Now writing out monochrome bitmaps from 8-bit arrays works as it does when using PNG. Bitmaps need 3 bytes per pixel. --- stb_image_write.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stb_image_write.h b/stb_image_write.h index 4319c0d..c29cba9 100644 --- a/stb_image_write.h +++ b/stb_image_write.h @@ -293,9 +293,7 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in s->func(s->context, &d[comp - 1], 1); switch (comp) { - case 1: - s->func(s->context,d,1); - break; + case 1: /* fall-through wanted */ case 2: if (expand_mono) stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp