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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
foutrelis
Posts: 3
Joined: 2013-03-24T23:51:49-07:00
Authentication code: 6789

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
alexg90
Posts: 2
Joined: 2013-08-20T03:37:23-07:00
Authentication code: 6789

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

Post 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
alexg90
Posts: 2
Joined: 2013-08-20T03:37:23-07:00
Authentication code: 6789

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

Post 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.
Marquisk2
Posts: 4
Joined: 2013-09-09T08:50:53-07:00
Authentication code: 6789

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

Post 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.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

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

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply