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
Im trying to use your PhotoSauce to resize a image loaded on Memory stream, is it possible to make it supported on Blazor?
Code that Im using:
var memoryStream = new MemoryStream(bytes, true);
var settings = new ProcessImageSettings { Width = Width , Height = Height };
var outStream = new FileStream(file.Name, FileMode.OpenOrCreate, FileAccess.ReadWrite);
MagicImageProcessor.ProcessImage(memoryStream, outStream, settings);
I Get this error:
The type initializer for 'PhotoSauce.Interop.Wic.IStreamImpl' threw an exception.
---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Runtime.CompilerServices.RuntimeHelpers.AllocateTypeAssociatedMemory(Type type, Int32 size)
at PhotoSauce.Interop.Wic.IStreamImpl.createVtbl()
at PhotoSauce.Interop.Wic.IStreamImpl..cctor()
The text was updated successfully, but these errors were encountered:
Yeah, that error would be expected for WASM -- for now. Currently, we require access to the Windows native codecs to decode and encode images . Almost all of the remaining pipeline is pure managed code and should work in WASM, but in the current release, it would be a challenge to integrate.
The upcoming release will add support for pluggable codecs. That might include the standard set of xplat codecs (libjpeg, libpng, etc) compiled with emscipten, or managed codecs such as the ones from ImageSharp, which are implemented in pure C#. WASM is a lower priority at the moment than Linux, but both will be supported out of the box eventually.
It's worth noting that since Blazor now supports native assembly loading in Wasm, this might work. See the Sqlite demos that load the unmanaged DLL directly into the browser.
I haven't had any time to look at this, but now that I have the base set of native codec packages done, it may not be too difficult to get them working in Wasm. vcpkg has a community-maintained triplet for Emscripten (https://github.com/microsoft/vcpkg/blob/master/triplets/community/wasm32-emscripten.cmake), and if anyone can get the codecs to reliably build with that, I could package them.
Im trying to use your PhotoSauce to resize a image loaded on Memory stream, is it possible to make it supported on Blazor?
Code that Im using:
var memoryStream = new MemoryStream(bytes, true);
var settings = new ProcessImageSettings { Width = Width , Height = Height };
var outStream = new FileStream(file.Name, FileMode.OpenOrCreate, FileAccess.ReadWrite);
MagicImageProcessor.ProcessImage(memoryStream, outStream, settings);
I Get this error:
The type initializer for 'PhotoSauce.Interop.Wic.IStreamImpl' threw an exception.
---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Runtime.CompilerServices.RuntimeHelpers.AllocateTypeAssociatedMemory(Type type, Int32 size)
at PhotoSauce.Interop.Wic.IStreamImpl.createVtbl()
at PhotoSauce.Interop.Wic.IStreamImpl..cctor()
The text was updated successfully, but these errors were encountered: