Your Location is: Home > Linux

Magick.NET on Mono crashes when creating an empty image

From: Australien View: 4455 Jujuba 

Question

I am using Magick.NET-Q8-x64.7.22.3 with Mono on Ubuntu 20.04.1. Having copied the native library with the lib prefix as outlined in the doc, I am able to run my program but get the following error whenever I try to create an empty MagickImage object:

GLib-GObject-WARNING **: 09:50:18.669: cannot register existing type 'gchar'
**
GLib-GObject:ERROR:../gobject/gvaluetypes.c:455:_g_value_types_init: assertion failed: (type == G_TYPE_CHAR)
Bail out! GLib-GObject:ERROR:../gobject/gvaluetypes.c:455:_g_value_types_init: assertion failed: (type == G_TYPE_CHAR)

with the following stacktrace:

  at <unknown> <0xffffffff>
  at NativeMagickSettings:.cctor <0x00023>
  at System.Object:runtime_invoke_void <0x00086>
  at <unknown> <0xffffffff>
  at System.Object:__icall_wrapper_mono_generic_class_init <0x0006d>
  at ImageMagick.MagickSettings:.ctor <0x000af>
  at ImageMagick.MagickImage:.ctor <0x0004f>

Package versions:

  • mono: 6.12.0.107
  • glib: 2.64.3
  • libc: 2.31

I am at a loss as to what may be causing this error, any help would be appreciated.

Best answer