From fc40209727ada7d5ee638ea06b0753cf4a97d089 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Mon, 16 Mar 2026 19:30:09 +0100 Subject: [PATCH] Test case for pixel type uint --- tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs | 10 ++++++++++ tests/ImageSharp.Tests/TestImages.cs | 3 ++- tests/Images/Input/Exr/rgb_uint32_uncompressed.exr | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/Images/Input/Exr/rgb_uint32_uncompressed.exr diff --git a/tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs index 9f1a532acc..beca934484 100644 --- a/tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs @@ -45,6 +45,16 @@ public class ExrDecoderTests image.CompareToOriginal(provider, ReferenceDecoder); } + [Theory] + [WithFile(TestImages.Exr.UncompressedUintRgb, PixelTypes.Rgba32)] + public void ExrDecoder_CanDecode_Uncompressed_Rgb_ExrPixelType_Uint(TestImageProvider provider) + where TPixel : unmanaged, IPixel + { + using Image image = provider.GetImage(ExrDecoder.Instance); + image.DebugSave(provider); + image.CompareToOriginal(provider, ReferenceDecoder); + } + [Theory] [WithFile(TestImages.Exr.Rgb, PixelTypes.Rgba32)] public void ExrDecoder_CanDecode_Rgb(TestImageProvider provider) diff --git a/tests/ImageSharp.Tests/TestImages.cs b/tests/ImageSharp.Tests/TestImages.cs index 6d5302a9bc..1b0c0c865b 100644 --- a/tests/ImageSharp.Tests/TestImages.cs +++ b/tests/ImageSharp.Tests/TestImages.cs @@ -1384,12 +1384,13 @@ public static class TestImages public static class Exr { public const string Uncompressed = "Exr/Calliphora_uncompressed.exr"; + public const string UncompressedFloatRgb = "Exr/rgb_float32_uncompressed.exr"; + public const string UncompressedUintRgb = "Exr/rgb_uint32_uncompressed.exr"; public const string Zip = "Exr/Calliphora_zip.exr"; public const string Zips = "Exr/Calliphora_zips.exr"; public const string Rle = "Exr/Calliphora_rle.exr"; public const string B44 = "Exr/Calliphora_b44.exr"; public const string Rgb = "Exr/Calliphora_rgb.exr"; public const string Gray = "Exr/Calliphora_gray.exr"; - public const string UncompressedFloatRgb = "Exr/rgb_float32_uncompressed.exr"; } } diff --git a/tests/Images/Input/Exr/rgb_uint32_uncompressed.exr b/tests/Images/Input/Exr/rgb_uint32_uncompressed.exr new file mode 100644 index 0000000000..616b676c3c --- /dev/null +++ b/tests/Images/Input/Exr/rgb_uint32_uncompressed.exr @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8de6e6f5b1c5acfc67d84e228c45f47ec16a1635f90fd484dfaeb89c28278f10 +size 101408