1

I've just been attempting to use Magick.NET (Q16, AnyCpu) in my C# project. I installed it via nuget in Monodevelop (I'm on linux), and attempted to test it in my project with this code:

using ImageMagick;

// ...

MagickImage img = new MagickImage(requestedPath);
img.Thumbnail(new MagickGeometry(thumbnailWidth, thumbnailHeight));
cycle.Response.ContentType = "image/webp";
img.Write(httpContext.Response.OutputStream, MagickFormat.WebP);
img.Dispose();

...but I got an exception on the first line. Odd. Here's the relevant part of the stack trace:

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'X64' threw an exception. ---> System.EntryPointNotFoundException: SetDllDirectory
  at (wrapper managed-to-native) ImageMagick.NativeLibraryLoader+NativeMethods:SetDllDirectory (string)
  at ImageMagick.NativeLibraryLoader.ExtractLibrary () <0x4089f680 + 0x0009b> in <filename unknown>:0 
  at ImageMagick.NativeLibraryLoader.Load () <0x4089f640 + 0x00027> in <filename unknown>:0 
  at ImageMagick.MagickSettings+NativeMethods+X64..cctor () <0x4089f530 + 0x0000b> in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at ImageMagick.MagickSettings+NativeMagickSettings..ctor () <0x4089f3e0 + 0x00017> in <filename unknown>:0 
  at ImageMagick.MagickSettings..ctor () <0x4089efb0 + 0x000a7> in <filename unknown>:0 
  at ImageMagick.MagickImage..ctor () <0x4089eee0 + 0x00033> in <filename unknown>:0 
  at ImageMagick.MagickImage..ctor (System.String fileName) <0x4089ee90 + 0x00017> in <filename unknown>:0 
...

What's going on here?

1 Answer 1

2

Magick.NET only works on Windows at the moment. There are plans to add support for Linux in the .NET Core version of Magick.NET. At the time of writing it is unknown when that will happen.

EDIT: Support for Linux has been added. Support for Mac is still on the todo list.

3
  • Thanks for clearing that up. It's a shame there isn't a way to get it working. Is there an alternative image manipulation library I can use that's cross platform for generating thumbnails? Jul 9, 2016 at 12:12
  • @jayantsingh There is currently only support on Windows and Linux. Mac is still on the todo list.
    – dlemstra
    Nov 27, 2017 at 17:49
  • @dlemstra can u help me with that or how much long will it take for u ? or if you can suggest any other lib supporting filters like lanczos, bicubic and bilinear Nov 27, 2017 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.