Page 1 of 1

SVG to PNG fails with: "You forgot to call g_type_init()"

Posted: 2013-03-25T00:12:40-07:00
by foutrelis
It looks like the call to g_type_init() was recently removed from the svg coder [1]. (Reverting this change fixes the issue for me.)

The above appears to cause the following error when converting an SVG image to PNG (i.e. 'convert image.svg image.png'):

Code: Select all

(process:14556): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:14556): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed
The process hangs at this point and needs to be terminated with ^C.

Software versions used:

Code: Select all

imagemagick: 6.8.3.10
libpng: 1.5.14
librsvg: 2.36.4
glib2: 2.34.3
libxext: 1.3.1
This issue was originally reported on the Arch Linux bug tracker [2].

[1] http://trac.imagemagick.org/changeset/1 ... ders/svg.c
[2] https://bugs.archlinux.org/task/34448

Re: SVG to PNG fails with: "You forgot to call g_type_init()

Posted: 2013-03-25T04:59:02-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.4-0 Beta available by sometime tomorrow. Thanks.

Re: SVG to PNG fails with: "You forgot to call g_type_init()

Posted: 2013-08-20T04:59:30-07:00
by alexg90
I’m also experiencing the same bug however my version of ImageMagick is 6.8.6-8, running on Debian Wheezy.

Code: Select all

convert filename.svg test.png
Outputs (NOTE: process hangs)

Code: Select all

(process:12331): GLib-GObject-CRITICAL **: /tmp/buildd/glib2.0-2.33.12+really2.32.4/./gobject/gtype.c:2722: You forgot to call g_type_init()

(process:12331): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed
I’m not sure if this is of any help but here are the installed delegates.

Code: Select all

$ convert -list configure | grep DELEGATES
DELEGATES      bzlib djvu fontconfig freetype jbig jng jp2 jpeg lcms lqr openexr png ps rsvg tiff wmf x xml zlib

Re: SVG to PNG fails with: "You forgot to call g_type_init()

Posted: 2013-09-07T15:33:59-07:00
by alexg90
Does anyone know a solution to this issue? I've tried with the latest build (6.8.6-9) and still encountered the same error.

Re: SVG to PNG fails with: "You forgot to call g_type_init()

Posted: 2013-09-09T09:03:31-07:00
by Marquisk2
I had an older version of ImageMagick from 2012 under Centos 5.9 (6.2.x) and everything worked out fine with running this command:
convert -verbose /home/dev.logorally.com/htdocs/sites/default/files/private/assets/logos/bookmark1_6.svg /home/dev.logorally.com/htdocs/sites/default/files/temp/gsUZ4Zf9XSdXHydwoBQVYdn1kHARuybKMEmZwwl4IXY/5.png

I then decided to upgrade ImageMagick to 6.8.9 and tried to run the same exact command as previously but I get this error now:

sudo convert -verbose /home/dev.logorally.com/htdocs/sites/default/files/private/assets/logos/bookmark1_6.svg /home/dev.logorally.com/htdocs/sites/default/files/temp/gsUZ4Zf9XSdXHydwoBQVYdn1kHARuybKMEmZwwl4IXY/5.png
"inkscape" "/home/dev.logorally.com/htdocs/sites/default/files/private/assets/logos/bookmark1_6.svg" --export-png="/tmp/magick-22659jMAQUzlaF4Pl" --export-dpi="90,90" --export-background="rgb(100%,100%,100%)" --export-background-opacity="1" > "/tmp/magick-22659NQNqR-DOzr2N" 2>&1

(process:22659): GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed, use IA__g_type_init() prior to this function

(process:22659): GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed, use IA__g_type_init() prior to this function

(process:22659): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed
convert: memory allocation failed `/home/dev.logorally.com/htdocs/sites/default/files/private/assets/logos/bookmark1_6.svg' @ error/svg.c/ReadSVGImage/2918.
convert: no images defined `/home/dev.logorally.com/htdocs/sites/default/files/temp/gsUZ4Zf9XSdXHydwoBQVYdn1kHARuybKMEmZwwl4IXY/5.png' @ error/convert.c/ConvertImageCommand/3127.


I'm at a loss and I need this working :( Even if it's saying out of memory I tried -memory and -map. I have a dedicated web server so there should be enough ram.

Re: SVG to PNG fails with: "You forgot to call g_type_init()

Posted: 2013-09-09T11:07:51-07:00
by dlemstra
A patch for this problem has been already been committed: http://trac.imagemagick.org/changeset/13123. This will be fixed in 6.8.6-10.