From 0a52ee7514d114299752a8255084681ba23018a8 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Thu, 20 Feb 2025 17:49:12 +0100 Subject: [PATCH] Try fix build issue with ubuntu latest and net9.0 --- tests/ImageSharp.Tests/Formats/WebP/WebpCommonUtilsTests.cs | 4 ++-- tests/ImageSharp.Tests/Image/ImageFrameTests.cs | 2 +- tests/ImageSharp.Tests/Image/ImageTests.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ImageSharp.Tests/Formats/WebP/WebpCommonUtilsTests.cs b/tests/ImageSharp.Tests/Formats/WebP/WebpCommonUtilsTests.cs index a3fe028db5..80302db393 100644 --- a/tests/ImageSharp.Tests/Formats/WebP/WebpCommonUtilsTests.cs +++ b/tests/ImageSharp.Tests/Formats/WebP/WebpCommonUtilsTests.cs @@ -106,7 +106,7 @@ public class WebpCommonUtilsTests 174, 183, 189, 255, 148, 158, 158, 255, }; - Span row = MemoryMarshal.Cast(rowBytes); + Span row = MemoryMarshal.Cast((Span)rowBytes); bool noneOpaque; for (int length = 8; length < row.Length; length += 8) @@ -188,7 +188,7 @@ public class WebpCommonUtilsTests 174, 183, 189, 255, 148, 158, 158, 255, }; - Span row = MemoryMarshal.Cast(rowBytes); + Span row = MemoryMarshal.Cast((Span)rowBytes); bool noneOpaque; for (int length = 8; length < row.Length; length += 8) diff --git a/tests/ImageSharp.Tests/Image/ImageFrameTests.cs b/tests/ImageSharp.Tests/Image/ImageFrameTests.cs index e09ef487a8..ef5b5f4def 100644 --- a/tests/ImageSharp.Tests/Image/ImageFrameTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageFrameTests.cs @@ -112,7 +112,7 @@ public class ImageFrameTests } byte[] expected = TestUtils.FillImageWithRandomBytes(image); - byte[] actual = new byte[expected.Length]; + Span actual = new byte[expected.Length]; if (byteSpan) { image.Frames.RootFrame.CopyPixelDataTo(actual); diff --git a/tests/ImageSharp.Tests/Image/ImageTests.cs b/tests/ImageSharp.Tests/Image/ImageTests.cs index ac91ea948e..16b8962c70 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.cs @@ -190,7 +190,7 @@ public partial class ImageTests } byte[] expected = TestUtils.FillImageWithRandomBytes(image); - byte[] actual = new byte[expected.Length]; + Span actual = new byte[expected.Length]; if (byteSpan) { image.CopyPixelDataTo(actual);