From fe05e43b017d1825abd1aca2ee837d9ea4c032a0 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Sat, 26 Oct 2019 21:22:25 +0200 Subject: [PATCH] Fix build error in Release mode --- src/ImageSharp/Formats/Tga/TgaEncoderCore.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ImageSharp/Formats/Tga/TgaEncoderCore.cs b/src/ImageSharp/Formats/Tga/TgaEncoderCore.cs index 0b0e0b193..139cc13fd 100644 --- a/src/ImageSharp/Formats/Tga/TgaEncoderCore.cs +++ b/src/ImageSharp/Formats/Tga/TgaEncoderCore.cs @@ -100,7 +100,7 @@ namespace SixLabors.ImageSharp.Formats.Tga #if NETCOREAPP2_1 Span buffer = stackalloc byte[TgaFileHeader.Size]; #else - var buffer = new byte[TgaFileHeader.Size]; + byte[] buffer = new byte[TgaFileHeader.Size]; #endif fileHeader.WriteTo(buffer); @@ -161,7 +161,7 @@ namespace SixLabors.ImageSharp.Formats.Tga { Rgba32 color = default; Buffer2D pixels = image.PixelBuffer; - Span pixelSpan = pixels.Span; + Span pixelSpan = pixels.GetSpan(); int totalPixels = image.Width * image.Height; int encodedPixels = 0; while (encodedPixels < totalPixels) @@ -341,7 +341,7 @@ namespace SixLabors.ImageSharp.Formats.Tga public static int GetLuminance(TPixel sourcePixel) where TPixel : struct, IPixel { - Vector4 vector = sourcePixel.ToVector4(); + var vector = sourcePixel.ToVector4(); return GetLuminance(ref vector); }