From 101619a9e6d8f0a1dc1c55ed8bd25f989a6c9187 Mon Sep 17 00:00:00 2001 From: treeform Date: Mon, 19 Apr 2021 08:48:51 -0700 Subject: [PATCH] Fix small png loading bug. --- src/pixie/fileformats/png.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pixie/fileformats/png.nim b/src/pixie/fileformats/png.nim index ea2025e..d44b3ec 100644 --- a/src/pixie/fileformats/png.nim +++ b/src/pixie/fileformats/png.nim @@ -104,7 +104,9 @@ proc unfilter( let filterType = uncompressed[uncompressedIdx(0, y)] case filterType: of 0: # None - discard + for x in 0 ..< rowBytes: + var value = uncompressed[uncompressedIdx(x + 1, y)] + result[unfiteredIdx(x, y)] = value of 1: # Sub for x in 0 ..< rowBytes: var value = uncompressed[uncompressedIdx(x + 1, y)]