Browse Source

Use explicit ReadOnlySpan to fix CI build with preview lang

pull/2894/head
James Jackson-South 12 months ago
parent
commit
19ea81575f
  1. 6
      src/ImageSharp/Formats/Png/PngEncoderCore.cs

6
src/ImageSharp/Formats/Png/PngEncoderCore.cs

@ -1255,7 +1255,8 @@ internal sealed class PngEncoderCore : IDisposable
Span<byte> attempt = attemptBuffer.GetSpan();
for (int y = 0; y < pixels.Height; y++)
{
this.CollectAndFilterPixelRow(pixels.DangerousGetRowSpan(y), ref filter, ref attempt, quantized, y);
ReadOnlySpan<TPixel> rowSpan = pixels.DangerousGetRowSpan(y);
this.CollectAndFilterPixelRow(rowSpan, ref filter, ref attempt, quantized, y);
deflateStream.Write(filter);
this.SwapScanlineBuffers();
}
@ -1303,7 +1304,8 @@ internal sealed class PngEncoderCore : IDisposable
// Encode data
// Note: quantized parameter not used
// Note: row parameter not used
this.CollectAndFilterPixelRow(block, ref filter, ref attempt, null, -1);
ReadOnlySpan<TPixel> blockSpan = block;
this.CollectAndFilterPixelRow(blockSpan, ref filter, ref attempt, null, -1);
deflateStream.Write(filter);
this.SwapScanlineBuffers();

Loading…
Cancel
Save