dlemstra / Magick.NET

The .NET library for ImageMagick
Apache License 2.0
3.43k stars 413 forks source link

Magick.NET Xamarin install - Magick.Native-Q16-x64.dll not found #1225

Closed yosh-wheels closed 2 years ago

yosh-wheels commented 2 years ago

Magick.NET version

11.3

Environment (Operating system, version and so on)

Xamarin (NetStandard 2.03) running on Android emulator (Pixel 4) VS2022 on Widows 10

Description

I am trying to add Magick.NET to a Xamarin solution to process HEIC images in a mobile app. I get: System.DllNotFoundException: 'Magick.Native-Q16-x64.dll assembly: type: member:(null)' when I try to create a MagicImage. Here is what I have tried: In VS I installed Magick.NET-Q16-x64 nuget package in the Xamarin shared project I added some simple code: using (MagickImage bmp = new MagickImage(binary)) { bmp.Write(outputStream, MagickFormat.Jpg); }

Ran solution and got DllNotFoundException. Since I couldn't find any such dll in the solution, I manually downloaded the Nuget package and extracted the file from runtimes/winx-64/native and pasted it in to both the shared project and android output folders. Still same error. I added the same nuget package (Magick.Native-Q16-x64) to both android and IOS projects. Still same error.

Any help would be greatly appreciated

Steps to Reproduce

Add Magick.Native-Q16-x64 to a Xamarin project and add some code to use it in the shared projec Snag_5c7ce42 t

dlemstra commented 2 years ago

This looks like a duplicate of #22?

yosh-wheels commented 2 years ago

Are you referring to the solution from [snechaev]? It is for OsX. It also states: Note: this solution will not work on Iphone/android because of lack of the native ImageMagick libraries built for these platforms. This is also will not work with AnyCPU builds, because this builds will extract (wrong) native library at runtime.

Are there any instructions somewhere how to add Magick.Net to Xamarin?

dlemstra commented 2 years ago

I don't think you can run Magick.NET on Xamarin now. And I don't have the time/hardware to figure out how to make this work.

Shahid-khan5 commented 4 months ago

Can I run Magick.NET on .NET MAUI now?