Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch WASM profile to use bundled zlib #8216

Open
kumpera opened this Issue Apr 12, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@kumpera
Copy link
Member

kumpera commented Apr 12, 2018

Found in aspnet/Blazor#445

We need to change the BCL to pinvoke __Internal for zlib:

#if MONOTOUCH || MONODROID
const string LIBNAME = "__Internal";
#else
const string LIBNAME = "MonoPosixHelper";
#endif
#if !ORBIS
[DllImport (LIBNAME, CallingConvention=CallingConvention.Cdecl)]
static extern SafeDeflateStreamHandle CreateZStream (CompressionMode compress, bool gzip, UnmanagedReadOrWrite feeder, IntPtr data);
[DllImport (LIBNAME, CallingConvention=CallingConvention.Cdecl)]
static extern int CloseZStream (IntPtr stream);
[DllImport (LIBNAME, CallingConvention=CallingConvention.Cdecl)]
static extern int Flush (SafeDeflateStreamHandle stream);
[DllImport (LIBNAME, CallingConvention=CallingConvention.Cdecl)]
static extern int ReadZStream (SafeDeflateStreamHandle stream, IntPtr buffer, int length);
[DllImport (LIBNAME, CallingConvention=CallingConvention.Cdecl)]
static extern int WriteZStream (SafeDeflateStreamHandle stream, IntPtr buffer, int length);

Then we need to change the runtime to bundle it.

@SQL-MisterMagoo

This comment has been minimized.

Copy link

SQL-MisterMagoo commented Feb 16, 2019

Hi, is this change likely to happen? I'm guessing more and more projects will hit this as Blazor takes off.
Does this issue need more support?

@adv12

This comment has been minimized.

Copy link

adv12 commented Apr 10, 2019

Just chiming in here. I'm trying to load/save PNG images in Blazor and getting a System.DllNotFoundException when ImageSharp tries to use DEFLATE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.