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
2.1.0
Other ImageSharp packages and versions
None
Environment (Operating system, version and so on)
Windows 11
.NET Framework version
.Net 6
Description
I'm currently writing a Blazor Client Side application where i need some raw pixel data of pretty large jpeg images. Please take a look at the following code:
using (MemoryStream ms = new MemoryStream(bytes))
{
JpegDecoder decoder = new JpegDecoder();
var image = decoder.Decode<Rgb24>(Configuration.Default, ms, CancellationToken.None)}
Assume that bytes is a byte array filled with the data of a 5000x5000 pixel jpeg file, this code needs about 5 Minutes to complete. I've tested this with several browsers in release and debug mode.
If i run the same code on the same machine in a WPF desktop app, it is pretty fast (3 sec or something like that).
If i evaluate System.Numerics.Vector.IsHardwareAccelerated, which I saw in similar issues, I get false on my Blazor App but true on my WPF Desktop app. I assume this is the problem but I am still shocked how much difference hardware acceleration brings in case of decoding a jpeg.
What can I do to fix this?
Steps to Reproduce
Create a new Blazor Clientside App and paste the code above in any code block to run it.
The text was updated successfully, but these errors were encountered:
@JimBobSquarePants Thanks for your input and suggestions! I've tried the AOT-Compile Solution but sadly it's still as slow as it was. I really hope this will improve some day :(
Yeah I am sure about the format :) The API the images are pulled from is in my hand - so is the client that creates those images. I think I'll switch to png which is a lot larger but way faster to decode.
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
2.1.0
Other ImageSharp packages and versions
None
Environment (Operating system, version and so on)
Windows 11
.NET Framework version
.Net 6
Description
I'm currently writing a Blazor Client Side application where i need some raw pixel data of pretty large jpeg images. Please take a look at the following code:
Assume that
bytes
is a byte array filled with the data of a 5000x5000 pixel jpeg file, this code needs about 5 Minutes to complete. I've tested this with several browsers in release and debug mode.If i run the same code on the same machine in a WPF desktop app, it is pretty fast (3 sec or something like that).
If i evaluate
System.Numerics.Vector.IsHardwareAccelerated
, which I saw in similar issues, I getfalse
on my Blazor App buttrue
on my WPF Desktop app. I assume this is the problem but I am still shocked how much difference hardware acceleration brings in case of decoding a jpeg.What can I do to fix this?
Steps to Reproduce
Create a new Blazor Clientside App and paste the code above in any code block to run it.
The text was updated successfully, but these errors were encountered: