diff --git a/.gitignore b/.gitignore index a89cfcf10..475d6e76b 100644 --- a/.gitignore +++ b/.gitignore @@ -221,3 +221,4 @@ artifacts/ # Tests **/Images/ActualOutput **/Images/ReferenceOutput +.DS_Store diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/RgbaVector.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/RgbaVector.PixelOperations.cs index 1605d862e..c66526bbe 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/RgbaVector.PixelOperations.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/RgbaVector.PixelOperations.cs @@ -26,6 +26,17 @@ namespace SixLabors.ImageSharp.PixelFormats /// public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value; + /// + public override void From( + Configuration configuration, + ReadOnlySpan sourcePixels, + Span destinationPixels) + { + Span destinationVectors = MemoryMarshal.Cast(destinationPixels); + + PixelOperations.Instance.ToVector4(configuration, sourcePixels, destinationVectors); + } + /// public override void FromVector4Destructive( Configuration configuration, diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs index 47d951837..4a20f4e56 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -35,7 +35,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms nameof(KnownResamplers.Lanczos5), }; - private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.07F); + private static readonly ImageComparer ValidatorComparer = + ImageComparer.TolerantPercentage(TestEnvironment.IsOSX && TestEnvironment.RunsOnCI ? 0.26F : 0.07F); [Fact] public void Resize_PixelAgnostic() @@ -355,7 +356,6 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms } [Theory] - [PlatformSpecific(~TestPlatforms.OSX)] [WithFileCollection(nameof(CommonTestImages), DefaultPixelType)] public void ResizeFromSourceRectangle(TestImageProvider provider) where TPixel : unmanaged, IPixel @@ -438,7 +438,6 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms } [Theory] - [PlatformSpecific(~TestPlatforms.OSX)] [WithFileCollection(nameof(CommonTestImages), DefaultPixelType)] public void ResizeWithBoxPadMode(TestImageProvider provider) where TPixel : unmanaged, IPixel @@ -549,7 +548,6 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms } [Theory] - [PlatformSpecific(~TestPlatforms.OSX)] [WithFileCollection(nameof(CommonTestImages), DefaultPixelType)] public void ResizeWithPadMode(TestImageProvider provider) where TPixel : unmanaged, IPixel diff --git a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs index 48728faf0..b80a29646 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs @@ -108,6 +108,8 @@ namespace SixLabors.ImageSharp.Tests internal static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + internal static bool IsOSX => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + internal static bool IsMono => Type.GetType("Mono.Runtime") != null; // https://stackoverflow.com/a/721194 internal static bool IsWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows);