[pygtk] Using PyGI and cairo & rsvg - loading a SVG file into an ImageSurface

Timo timomlists at gmail.com
Fri Nov 30 18:35:11 WST 2012


Op 29-11-12 22:58, Christian Mallwitz schreef:
> Hi,
>
> I tried to use PyGT / cairo and it is working fine for me so far but I
> wanted to load a SVG, scale it and paint over it using cairo and than
> display it using PyGI at the end.
>
> So I installed python-rsvg 2.32.0 from the Ubuntu precise repo.
>
> If I use just cairo and rsvg everything is fine: I can read SVG files
> manipulate them in cairo and save the result as PNG.
>
> But the moment I combine it with PyGI the process core dumps:
>
> /usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning:
> g_boxed_type_register_static: assertion `g_type_from_name (name) == 0'
> failed
> TypeError: metaclass conflict: the metaclass of a derived class must
> be a (non-strict) subclass of the metaclasses of all its bases
> **
> ERROR:/build/buildd/pygobject-3.2.2/gi/_gobject/pygobject.c:929:pygobject_new_full:
> assertion failed: (tp != NULL)
> line 8: 30868 Aborted                 (core dumped) python main.py
>
> It looks like python-rsvg is using old style bindings from PyGTK v2
> which is clashing with PyGI.
>
> Do I miss something? I couldn't find anything rsvg related for
> gi.repository. Any hints?
I don't know about Precise, but in Quantal there's a package called 
gir1.2-rsvg-2.0
You should have a look at that.

Timo


>
> Thanks
> Christian
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/



More information about the pygtk mailing list