Initialize QImage before rendering SVG
I do not know if QImage used to automatically clear the internal buffer in the past, but it does not do so now. Therefore SVG rendering is broken, because the internal QImage bufer is never cleared before being rendered upon.
@@ -86,6 +86,7 @@ def svg_to_image(string, size=None):
if size is None:
size = renderer.defaultSize()
image = QtGui.QImage(size, QtGui.QImage.Format_ARGB32)
+ image.fill(0)
painter = QtGui.QPainter(image)
renderer.render(painter)
return image
