-
-
Notifications
You must be signed in to change notification settings - Fork 888
Closed
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUGandRELEASEmode - I have searched open and closed issues to ensure it has not already been reported
Description
Following this sample: https://docs.sixlabors.com/articles/imagesharp/memorymanagement.html#enforcing-contiguous-buffers
but instead loading an image file
using (Image<Rgba32> image = Image.Load<Rgba32>(customConfig, "big.png"))will result in discontigous memory being used.
This is probably caused by https://github.com/SixLabors/ImageSharp/blob/master/src/ImageSharp/Image.Decode.cs#L41
not passing configuration.PreferContiguousImageBuffers to Allocate2D. Adding this extra parameter fixes the issue on my use case.
I did not open a PR for that, since I am not familiar with ImageSharps internal workings and am not sure if this issue also exists elsewhere.
Steps to Reproduce
https://github.com/roeyskoe/ImageSharpContiguous
System Configuration
- ImageSharp version: 2.0.0 (also when using latest source)
- Other ImageSharp packages and versions: -
- Environment (Operating system, version and so on): Windows 10 x64 10.0.19044
- .NET Framework version: .NET 6
- Additional information: