From cc151888338a7e4fce4b0dc59c30eea7535a5055 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 19 Sep 2015 17:48:15 -0400 Subject: [PATCH] 1bpp bug --- png.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/png.d b/png.d index fca2381..1960887 100644 --- a/png.d +++ b/png.d @@ -143,6 +143,8 @@ MemoryImage imageFromPng(PNG* png) { pixel++; if(pixel == h.width) break loop; idata[idataIdx++] = (b >> 2) & 0x01; pixel++; if(pixel == h.width) break loop; + idata[idataIdx++] = (b >> 1) & 0x01; + pixel++; if(pixel == h.width) break loop; idata[idataIdx++] = b & 0x01; break; case 2: @@ -1202,8 +1204,9 @@ struct LazyPngFile(LazyPngChunksProvider) if(chunks.front().stype != "IDAT") { buffer ~= cast(ubyte[]) decompressor.flush(); if(buffer.length != 0) { - buffer ~= cast(ubyte[]) - decompressor.uncompress(chunks.front().payload); + // FIXME why was this here? + //buffer ~= cast(ubyte[]) + //decompressor.uncompress(chunks.front().payload); continue; } current = null;