Conversation
# Conflicts: # src/ImageSharp/Configuration.cs
# Conflicts: # src/ImageSharp/Formats/Bmp/BmpConstants.cs # src/ImageSharp/Formats/Bmp/BmpDecoder.cs # src/ImageSharp/Formats/Bmp/BmpFormat.cs
# Conflicts: # src/ImageSharp/Configuration.cs # src/ImageSharp/Formats/Bmp/BmpArrayFileHeader.cs # src/ImageSharp/Formats/Bmp/BmpConstants.cs # src/ImageSharp/Formats/Bmp/BmpFormat.cs # src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs # src/ImageSharp/Formats/ImageExtensions.Save.cs # src/ImageSharp/Formats/Pbm/BufferedReadStreamExtensions.cs # tests/ImageSharp.Tests/ConfigurationTests.cs # tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs
# Conflicts: # src/ImageSharp/Configuration.cs # src/ImageSharp/Formats/Bmp/BmpArrayFileHeader.cs # src/ImageSharp/Formats/Bmp/BmpConstants.cs # src/ImageSharp/Formats/Bmp/BmpDecoder.cs # src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs # src/ImageSharp/Formats/Bmp/BmpFileHeader.cs # src/ImageSharp/Formats/Bmp/BmpFormat.cs # src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs # src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs # src/ImageSharp/Formats/ImageDecoderUtilities.cs # src/ImageSharp/Formats/ImageExtensions.Save.cs # src/ImageSharp/Formats/Pbm/BufferedReadStreamExtensions.cs # src/ImageSharp/Image.Decode.cs # tests/ImageSharp.Tests/ConfigurationTests.cs # tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs
# Conflicts: # src/ImageSharp/Formats/Bmp/BmpFormat.cs # src/ImageSharp/Formats/ImageDecoderUtilities.cs # src/ImageSharp/Formats/ImageExtensions.Save.cs # src/ImageSharp/Formats/OpenExr/ExrDecoderCore.cs
# Conflicts: # src/ImageSharp/Configuration.cs # src/ImageSharp/Formats/ImageDecoderUtilities.cs # tests/ImageSharp.Tests/TestUtilities/TestEnvironment.Formats.cs
| PixelAlphaRepresentation.Unassociated); | ||
|
|
||
| /// <inheritdoc/> | ||
| public readonly Rgba32 ToRgba32() => throw new NotImplementedException(); |
There was a problem hiding this comment.
We need to implement all these.
There was a problem hiding this comment.
this is now implemented
| See https://github.com/ImageMagick/ImageMagick/commit/27a0a9c37f18af9c8d823a3ea076f600843b553c | ||
| --> | ||
| <PackageReference Update="Magick.NET-Q16-AnyCPU" Version="13.10.0" /> | ||
| <PackageReference Update="Magick.NET-Q16-AnyCPU" Version="14.11.1" /> |
There was a problem hiding this comment.
Oh, you got this working!! Fantastic!! 🙌
There was a problem hiding this comment.
I had to upgrade to the latest version of Magick.NET, because of an issue decoding some exr files, which was fixed here
Unfortunately this also changed how some bitmaps which are RLE compressed are decoded. I had to change some testcases to use CompareToReferenceOutput instead of using the reference decoder: 0c3ca3d
There was a problem hiding this comment.
I'm absolutely fine with CompareToReferenceOutput . Our decoder is rock solid now and that should be enough to protect against regression.
| for (int i = 1; i < predicted.Length; i++) | ||
| { | ||
| int d = (predicted[i] - p + 128 + 256) & 255; | ||
| p = predicted[i]; |
|
|
||
| if (totalRead == 0) | ||
| { | ||
| ExrThrowHelper.ThrowInvalidImageContentException("Could not read zip compressed image data!"); |
There was a problem hiding this comment.
I wonder if we should just break here? Normally we try to return as much pixel information as we can.
|
|
||
| namespace SixLabors.ImageSharp.Formats.Exr.Compression; | ||
|
|
||
| internal abstract class ExrBaseDecompressor : ExrBaseCompression |
There was a problem hiding this comment.
I know these types are internal but I'm finding it very useful currently to document the crap out of everything (AI really helps here.)
@JimBobSquarePants: dont worry keep your time, it is not urgent. Just as a heads up: I noticed issues with the pixel conversion methods introduced with the new pixel types. I am trying to add tests for them in the next days. Those conversion methods will change, so maybe exclude them from a review until then, because they will change anyway. |
There was a problem hiding this comment.
This output looks bugged to me. Has the Magick comparison been hiding an issue?
There was a problem hiding this comment.
The image is from the bmp suite where alot of the edge case image in the tests come from.
From the description of the image:
An RLE-compressed image that uses “delta” codes, and early EOL & EOBMP markers, to skip over some pixels. It’s okay if the viewer’s image doesn’t exactly match any of the reference images.
It looks like the third image in the "correct display" list: the undefined pixels are black.

Prerequisites
Description
This PR adds support for decoding and encoding of images in the OpenEXR format. OpenEXR is a HDR image format, therefore I have added two new pixel formats
Rgb96andRgba128which store each color channel asUInt32.The specification can be found here: https://openexr.com/en/latest/index.html#openexr
A reference implementation can be found here: https://github.com/AcademySoftwareFoundation/openexr.git