You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that I am running the latest version of ImageSharp
I have verified if the problem exist in both DEBUG and RELEASE mode
I have searched open and closed issues to ensure it has not already been reported
ImageSharp version
3.0.1
Environment (Operating system, version and so on)
Windows 11 Version 22H2
.NET Framework version
.NET 7.0.304
Description
Async methods that read/write from the file system, such as Image.LoadAsync and Image.SaveAsync, use async methods on FileStream but don't instantiate the FileStream with FileOptions.Asynchronous, as should be done when using async operations. This means that the implementation isn't actually truly async and instead uses synchronous IO on a new thread, needlessly using more resources.
There is a simple workaround for this by creating the FileStream manually and giving ImageSharp the stream as opposed to the file path, e.g.:
but I feel like this is a bug and should be fixed in ImageSharp itself. The method is misleading, suggesting that it uses async IO while actually doesn't.
The text was updated successfully, but these errors were encountered:
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
3.0.1
Environment (Operating system, version and so on)
Windows 11 Version 22H2
.NET Framework version
.NET 7.0.304
Description
Async methods that read/write from the file system, such as
Image.LoadAsync
andImage.SaveAsync
, use async methods onFileStream
but don't instantiate theFileStream
withFileOptions.Asynchronous
, as should be done when using async operations. This means that the implementation isn't actually truly async and instead uses synchronous IO on a new thread, needlessly using more resources.There is a simple workaround for this by creating the
FileStream
manually and giving ImageSharp the stream as opposed to the file path, e.g.:but I feel like this is a bug and should be fixed in ImageSharp itself. The method is misleading, suggesting that it uses async IO while actually doesn't.
The text was updated successfully, but these errors were encountered: