From 6734f5eef94026cae8c1f76cf6fb157cefec1ebe Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Wed, 15 Jun 2022 16:11:29 -0500 Subject: [PATCH] simpler, faster --- src/pixie/fileformats/png.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pixie/fileformats/png.nim b/src/pixie/fileformats/png.nim index 7020d4f..77ef310 100644 --- a/src/pixie/fileformats/png.nim +++ b/src/pixie/fileformats/png.nim @@ -344,8 +344,7 @@ proc decodeImageData( unfiltered.readUint8(bytePos + 1) ) of 6: - for i in 0 ..< header.height * header.width: - result[i] = cast[ColorRGBA](unfiltered.readUint32(i * 4)) + copyMem(result[0].addr, unfiltered[0].unsafeAddr, unfiltered.len) else: discard # Not possible, parseHeader validates