Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,19 @@ jobs:
sdk-preview: true
runtime: -x64
codecov: false
- os: macos-26
framework: net9.0
sdk: 9.0.x
sdk-preview: true
runtime: -x64
codecov: false
- os: windows-latest
framework: net9.0
sdk: 9.0.x
sdk-preview: true
runtime: -x64
codecov: false
- os: buildjet-4vcpu-ubuntu-2204-arm
- os: ubuntu-22.04-arm
framework: net9.0
sdk: 9.0.x
sdk-preview: true
Expand All @@ -100,12 +106,17 @@ jobs:
sdk: 8.0.x
runtime: -x64
codecov: false
- os: macos-26
framework: net8.0
sdk: 8.0.x
runtime: -x64
codecov: false
- os: windows-latest
framework: net8.0
sdk: 8.0.x
runtime: -x64
codecov: false
- os: buildjet-4vcpu-ubuntu-2204-arm
- os: ubuntu-22.04-arm
framework: net8.0
sdk: 8.0.x
runtime: -x64
Expand Down
10 changes: 10 additions & 0 deletions tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public void BmpDecoder_CanDecode_Inverted<TPixel>(TestImageProvider<TPixel> prov
public void BmpDecoder_CanDecode_1Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

using Image<TPixel> image = provider.GetImage(BmpDecoder.Instance);
image.DebugSave(provider);
image.CompareToOriginal(provider, new SystemDrawingReferenceDecoder(BmpFormat.Instance));
Expand Down Expand Up @@ -144,6 +149,11 @@ public void BmpDecoder_CanDecode_4Bit<TPixel>(TestImageProvider<TPixel> provider
public void BmpDecoder_CanDecode_8Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

using Image<TPixel> image = provider.GetImage(BmpDecoder.Instance);
image.DebugSave(provider);
image.CompareToOriginal(provider);
Expand Down
2 changes: 1 addition & 1 deletion tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public void TiffDecoder_CanDecode_YccK<TPixel>(TestImageProvider<TPixel> provide
{
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
image.CompareToReferenceOutput(ImageComparer.Exact, provider);
image.CompareToReferenceOutput(ImageComparer.Tolerant(), provider);
}

[Theory]
Expand Down
2 changes: 2 additions & 0 deletions tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ internal static string GetReferenceOutputFileName(string actualOutputFileName) =

internal static bool Is64BitProcess => IntPtr.Size == 8;

internal static bool IsArm64Process => RuntimeInformation.ProcessArchitecture == Architecture.Arm64;

internal static bool IsFramework => NetCoreVersion == null;

internal static Architecture OSArchitecture => RuntimeInformation.OSArchitecture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public class MagickReferenceCodecTests
public void MagickDecode_8BitDepthImage_IsEquivalentTo_SystemDrawingResult<TPixel>(TestImageProvider<TPixel> dummyProvider, string testImage)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

string path = TestFile.GetInputFileFullPath(testImage);

MagickReferenceDecoder magickDecoder = MagickReferenceDecoder.Png;
Expand Down Expand Up @@ -61,6 +66,11 @@ public void MagickDecode_8BitDepthImage_IsEquivalentTo_SystemDrawingResult<TPixe
public void MagickDecode_16BitDepthImage_IsApproximatelyEquivalentTo_SystemDrawingResult<TPixel>(TestImageProvider<TPixel> dummyProvider, string testImage)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

string path = TestFile.GetInputFileFullPath(testImage);

MagickReferenceDecoder magickDecoder = MagickReferenceDecoder.Png;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public class SystemDrawingReferenceCodecTests
public void To32bppArgbSystemDrawingBitmap<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

using Image<TPixel> image = provider.GetImage();
using System.Drawing.Bitmap sdBitmap = SystemDrawingBridge.To32bppArgbSystemDrawingBitmap(image);
string fileName = provider.Utility.GetTestOutputFileName("png");
Expand All @@ -34,6 +39,11 @@ public void To32bppArgbSystemDrawingBitmap<TPixel>(TestImageProvider<TPixel> pro
public void From32bppArgbSystemDrawingBitmap<TPixel>(TestImageProvider<TPixel> dummyProvider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

string path = TestFile.GetInputFileFullPath(TestImages.Png.Splash);

using Bitmap sdBitmap = new(path);
Expand All @@ -59,7 +69,7 @@ private static string SavePng<TPixel>(TestImageProvider<TPixel> provider, PngCol
public void From32bppArgbSystemDrawingBitmap2<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsLinux)
if (TestEnvironment.IsLinux || (TestEnvironment.IsArm64Process && TestEnvironment.IsMacOS))
{
return;
}
Expand All @@ -78,6 +88,11 @@ public void From32bppArgbSystemDrawingBitmap2<TPixel>(TestImageProvider<TPixel>
public void From24bppRgbSystemDrawingBitmap<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

string path = SavePng(provider, PngColorType.Rgb);

using Image<TPixel> original = provider.GetImage();
Expand All @@ -92,6 +107,11 @@ public void From24bppRgbSystemDrawingBitmap<TPixel>(TestImageProvider<TPixel> pr
public void OpenWithReferenceDecoder<TPixel>(TestImageProvider<TPixel> dummyProvider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

string path = TestFile.GetInputFileFullPath(TestImages.Png.Splash);
using FileStream stream = File.OpenRead(path);
using Image<TPixel> image = SystemDrawingReferenceDecoder.Png.Decode<TPixel>(DecoderOptions.Default, stream);
Expand All @@ -103,6 +123,11 @@ public void OpenWithReferenceDecoder<TPixel>(TestImageProvider<TPixel> dummyProv
public void SaveWithReferenceEncoder<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS && TestEnvironment.IsArm64Process)
{
return;
}

using Image<TPixel> image = provider.GetImage();
provider.Utility.SaveTestOutputFile(image, "png", SystemDrawingReferenceEncoder.Png);
}
Expand Down
Loading