From 12f6582b1ab4032e1b6aafcff2acb43d09121b39 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Tue, 7 Jul 2020 11:27:22 +0100 Subject: [PATCH 1/9] Update all dependency references. --- Directory.Build.targets | 6 +++--- tests/Directory.Build.targets | 10 +++++----- tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs | 8 +++----- .../ReferenceCodecs/MagickReferenceDecoder.cs | 13 +++++-------- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index cc14bbdbf7..ab1193e93f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -25,12 +25,12 @@ - + - - + + diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index b2d2b1c319..118005382c 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -25,14 +25,14 @@ - - - + + + - + - + diff --git a/tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs b/tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs index af93884fda..58ed31e610 100644 --- a/tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs +++ b/tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs @@ -5,8 +5,6 @@ using System.IO; using ImageMagick; - -using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using Xunit; @@ -20,7 +18,7 @@ public static void CompareWithReferenceDecoder( Image image, bool useExactComparer = true, float compareTolerance = 0.01f) - where TPixel : unmanaged, IPixel + where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel { string path = TestImageProvider.GetFilePathOrNull(provider); if (path == null) @@ -41,7 +39,7 @@ public static void CompareWithReferenceDecoder( } public static Image DecodeWithMagick(Configuration configuration, FileInfo fileInfo) - where TPixel : unmanaged, IPixel + where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel { using (var magickImage = new MagickImage(fileInfo)) { @@ -50,7 +48,7 @@ public static Image DecodeWithMagick(Configuration configuration Assert.True(result.TryGetSinglePixelSpan(out Span resultPixels)); - using (IPixelCollection pixels = magickImage.GetPixelsUnsafe()) + using (IUnsafePixelCollection pixels = magickImage.GetPixelsUnsafe()) { byte[] data = pixels.ToByteArray(PixelMapping.RGBA); diff --git a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs index 4d1e754402..61016f2772 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs @@ -3,12 +3,9 @@ using System; using System.IO; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading.Tasks; using ImageMagick; - -using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; @@ -20,7 +17,7 @@ public class MagickReferenceDecoder : IImageDecoder public static MagickReferenceDecoder Instance { get; } = new MagickReferenceDecoder(); private static void FromRgba32Bytes(Configuration configuration, Span rgbaBytes, IMemoryGroup destinationGroup) - where TPixel : unmanaged, IPixel + where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel { foreach (Memory m in destinationGroup) { @@ -35,7 +32,7 @@ private static void FromRgba32Bytes(Configuration configuration, Span(Configuration configuration, Span rgbaBytes, IMemoryGroup destinationGroup) - where TPixel : unmanaged, IPixel + where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel { foreach (Memory m in destinationGroup) { @@ -50,17 +47,17 @@ private static void FromRgba64Bytes(Configuration configuration, Span> DecodeAsync(Configuration configuration, Stream stream) - where TPixel : unmanaged, IPixel + where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel => Task.FromResult(this.Decode(configuration, stream)); public Image Decode(Configuration configuration, Stream stream) - where TPixel : unmanaged, IPixel + where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel { using var magickImage = new MagickImage(stream); var result = new Image(configuration, magickImage.Width, magickImage.Height); MemoryGroup resultPixels = result.GetRootFramePixelBuffer().FastMemoryGroup; - using (IPixelCollection pixels = magickImage.GetPixelsUnsafe()) + using (IUnsafePixelCollection pixels = magickImage.GetPixelsUnsafe()) { if (magickImage.Depth == 8) { From 51337b9028da67978b993e3970502ef9f77f9517 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Tue, 7 Jul 2020 15:55:16 +0100 Subject: [PATCH 2/9] Try forcing binding redirects. --- tests/ImageSharp.Tests/ImageSharp.Tests.csproj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index 98f8e95745..efbd5cb055 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -10,6 +10,11 @@ SixLabors.ImageSharp.Tests true + + + + true + true From c0ac5464b0f7294d6be95e29a0a13701e1d5f0ea Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 10 Jul 2020 20:51:08 +0100 Subject: [PATCH 3/9] Revert several binary updates. --- Directory.Build.targets | 6 +++--- tests/ImageSharp.Tests/ImageSharp.Tests.csproj | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index ab1193e93f..cc14bbdbf7 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -25,12 +25,12 @@ - + - - + + diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index efbd5cb055..e828ae0576 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -13,8 +13,8 @@ - true - true + From 27af2549b58254a7779b209931e60086506dacfe Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jul 2020 12:30:03 +0100 Subject: [PATCH 4/9] Revert Magick changes --- tests/Directory.Build.targets | 2 +- tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs | 6 +++--- .../ReferenceCodecs/MagickReferenceDecoder.cs | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index 118005382c..e9e93a855f 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -29,7 +29,7 @@ - + diff --git a/tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs b/tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs index 58ed31e610..0f76d99317 100644 --- a/tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs +++ b/tests/ImageSharp.Tests/Formats/Tga/TgaTestUtils.cs @@ -18,7 +18,7 @@ public static void CompareWithReferenceDecoder( Image image, bool useExactComparer = true, float compareTolerance = 0.01f) - where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel + where TPixel : unmanaged, IPixel { string path = TestImageProvider.GetFilePathOrNull(provider); if (path == null) @@ -39,7 +39,7 @@ public static void CompareWithReferenceDecoder( } public static Image DecodeWithMagick(Configuration configuration, FileInfo fileInfo) - where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel + where TPixel : unmanaged, IPixel { using (var magickImage = new MagickImage(fileInfo)) { @@ -48,7 +48,7 @@ public static Image DecodeWithMagick(Configuration configuration Assert.True(result.TryGetSinglePixelSpan(out Span resultPixels)); - using (IUnsafePixelCollection pixels = magickImage.GetPixelsUnsafe()) + using (IPixelCollection pixels = magickImage.GetPixelsUnsafe()) { byte[] data = pixels.ToByteArray(PixelMapping.RGBA); diff --git a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs index 61016f2772..fae3ff5a5b 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs @@ -17,7 +17,7 @@ public class MagickReferenceDecoder : IImageDecoder public static MagickReferenceDecoder Instance { get; } = new MagickReferenceDecoder(); private static void FromRgba32Bytes(Configuration configuration, Span rgbaBytes, IMemoryGroup destinationGroup) - where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel + where TPixel : unmanaged, IPixel { foreach (Memory m in destinationGroup) { @@ -32,7 +32,7 @@ private static void FromRgba32Bytes(Configuration configuration, Span(Configuration configuration, Span rgbaBytes, IMemoryGroup destinationGroup) - where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel + where TPixel : unmanaged, IPixel { foreach (Memory m in destinationGroup) { @@ -47,17 +47,17 @@ private static void FromRgba64Bytes(Configuration configuration, Span> DecodeAsync(Configuration configuration, Stream stream) - where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel + where TPixel : unmanaged, IPixel => Task.FromResult(this.Decode(configuration, stream)); public Image Decode(Configuration configuration, Stream stream) - where TPixel : unmanaged, ImageSharp.PixelFormats.IPixel + where TPixel : unmanaged, IPixel { using var magickImage = new MagickImage(stream); var result = new Image(configuration, magickImage.Width, magickImage.Height); MemoryGroup resultPixels = result.GetRootFramePixelBuffer().FastMemoryGroup; - using (IUnsafePixelCollection pixels = magickImage.GetPixelsUnsafe()) + using (IPixelCollection pixels = magickImage.GetPixelsUnsafe()) { if (magickImage.Depth == 8) { From d4b4d2346713023e88e9076ab6b13d182f609566 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jul 2020 12:40:31 +0100 Subject: [PATCH 5/9] Remove comments --- tests/ImageSharp.Tests/ImageSharp.Tests.csproj | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index e828ae0576..98f8e95745 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -10,11 +10,6 @@ SixLabors.ImageSharp.Tests true - - - - From 3972a814cbd38cd8090b0297f54a21b4fec2c91d Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jul 2020 12:55:27 +0100 Subject: [PATCH 6/9] Update System.Buffers --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index cc14bbdbf7..375e9c0604 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -25,7 +25,7 @@ - + From dcde797b21c313b63858523a66c9d252ec4a1730 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jul 2020 13:15:01 +0100 Subject: [PATCH 7/9] Update System.Memory --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 375e9c0604..d18b6fa912 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -29,7 +29,7 @@ - + From 3ad93236dab3de7f17f1e481d3f3a9289d1a9f4a Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jul 2020 13:31:35 +0100 Subject: [PATCH 8/9] Revert "Update System.Memory" This reverts commit dcde797b21c313b63858523a66c9d252ec4a1730. --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index d18b6fa912..375e9c0604 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -29,7 +29,7 @@ - + From 83b6330b632edb354ae88ead797d541bf80eb24a Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jul 2020 13:34:12 +0100 Subject: [PATCH 9/9] Update System.Runtime.CompilerServices.Unsafe --- Directory.Build.targets | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 375e9c0604..4e7ab9e6b7 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -29,8 +29,12 @@ + - +