From ba0ea0c7176d7fea3101ee9623b1e0f8e28fb9f4 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 6 Jul 2019 12:43:48 -0400 Subject: [PATCH] greyscale fill all bytes --- png.d | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/png.d b/png.d index e43a5e9..25e567b 100644 --- a/png.d +++ b/png.d @@ -179,6 +179,11 @@ void convertPngData(ubyte type, ubyte depth, const(ubyte)[] data, int width, uby idata[idataIdx++] = p; idata[idataIdx++] = p; idata[idataIdx++] = p; + + if(type == 0) + idata[idataIdx++] = 255; + else if(type == 4) + idata[idataIdx++] = consumeOne(); } } @@ -226,11 +231,6 @@ void convertPngData(ubyte type, ubyte depth, const(ubyte)[] data, int width, uby default: assert(0, "bit depth not implemented"); } - - if(type == 0) - idata[idataIdx++] = 255; - else if(type == 4) - idata[idataIdx++] = consumeOne(); break; case 2: // truecolor case 6: // true with alpha