Skip to content

Commit

Permalink
PNG format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZILtoid1991 committed Jan 11, 2020
1 parent bee6137 commit daae48b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/dimage/png.d
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ public class PNG : Image{
if (!strm.avail_out) {//flush scanline into imagedata
version (unittest) scanlineCounter++;
version (unittest) assert (scanlineCounter <= result.header.height, "Scanline overflow!");
result.imageData ~= imageBuffer[0..$-1];
result.filterBytes ~= imageBuffer[$-1];
result.imageData ~= imageBuffer[1..$];
result.filterBytes ~= imageBuffer[0];
strm.next_out = imageBuffer.ptr;
strm.avail_out = cast(uint)imageBuffer.length;
}
Expand Down Expand Up @@ -401,8 +401,8 @@ public class PNG : Image{
input.reserve(imageData.length + filterBytes.length);
for (int line ; line < height ; line++){
const size_t offset = line * pitch;
input ~= imageData[offset..offset+pitch];
input ~= filterBytes[line];
input ~= imageData[offset..offset+pitch];
}

zlib.z_stream strm;
Expand Down

0 comments on commit daae48b

Please sign in to comment.