From b4cd27f2c9807832757944c7662fd52e8e8af54e Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Sat, 11 Apr 2026 19:22:05 +0200 Subject: [PATCH] Remove unnecessary ColorScaleTo32Bit when decoding pixel type uint32 --- src/ImageSharp/Formats/Exr/ExrDecoderCore.cs | 3 ++- tests/Images/Input/Exr/Calliphora_uint32_uncompressed.exr | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tests/Images/Input/Exr/Calliphora_uint32_uncompressed.exr diff --git a/src/ImageSharp/Formats/Exr/ExrDecoderCore.cs b/src/ImageSharp/Formats/Exr/ExrDecoderCore.cs index 7598c62f3a..6120314284 100644 --- a/src/ImageSharp/Formats/Exr/ExrDecoderCore.cs +++ b/src/ImageSharp/Formats/Exr/ExrDecoderCore.cs @@ -226,7 +226,8 @@ internal sealed class ExrDecoderCore : ImageDecoderCore for (int x = 0; x < width; x++) { - pixelRow[x] = ColorScaleTo32Bit(redPixelData[x], greenPixelData[x], bluePixelData[x], hasAlpha ? alphaPixelData[x] : uint.MaxValue); + Rgb96 pixelValue = new(redPixelData[x], greenPixelData[x], bluePixelData[x]); + pixelRow[x] = TPixel.FromVector4(pixelValue.ToVector4()); } decodedRows++; diff --git a/tests/Images/Input/Exr/Calliphora_uint32_uncompressed.exr b/tests/Images/Input/Exr/Calliphora_uint32_uncompressed.exr new file mode 100644 index 0000000000..867cffaa11 --- /dev/null +++ b/tests/Images/Input/Exr/Calliphora_uint32_uncompressed.exr @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bed68d2e491cad0bdd0fa668ce57328951927d722f130ba7c5c5475f6a3e0d96 +size 289183