From 3b1dc7250ec55f7d17b7e2473391b7b57407517a Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Tue, 8 Nov 2016 17:36:56 +1100 Subject: [PATCH] Add comments --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 8 ++++---- src/ImageSharp/Formats/Png/PngEncoderCore.cs | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index deb4ace411..ad5c6a2dc2 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -266,9 +266,9 @@ namespace ImageSharp.Formats /// /// The pixel format. /// The packed format. uint, long, float. - /// The pixel data. - /// The image pixels. - private void DecodePixelData(Stream pixelData, PixelAccessor pixels) + /// The compressed pixel data stream. + /// The image pixel accessor. + private void DecodePixelData(Stream compressedStream, PixelAccessor pixels) where TColor : struct, IPackedPixel where TPacked : struct { @@ -277,7 +277,7 @@ namespace ImageSharp.Formats byte[] scanline = new byte[this.bytesPerScanline]; for (int y = 0; y < this.header.Height; y++) { - pixelData.Read(scanline, 0, this.bytesPerScanline); + compressedStream.Read(scanline, 0, this.bytesPerScanline); FilterType filterType = (FilterType)scanline[0]; byte[] defilteredScanline; diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs index 9d68ba84a4..f7e79a52c5 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs @@ -590,6 +590,7 @@ namespace ImageSharp.Formats /// /// Writes the pixel information to the stream. + /// TODO: This is WHACK! We should be able to do this without creating yet another array. /// /// The stream. private void WriteDataChunks(Stream stream)