I have an SVG file that's stored as data in an associated XML file, and I need to display the SVG. However, since the SVG is loaded from the XML, it's currently in the program as a string. Is there any way to display the image without saving it in a temporary file? I've tried to inherit from StringIO to make a file-like object, but gtk.gdk.pixbuf_ new_from_file only takes the file name, as do similar GTK functions, and new_from_data wants RGB data, as does new_from_array. Is there a way to pass in a string that says 'Redirect the file stuff to this StringIO object'?
Storing the filepath to the image is a thought, though we have to parse the XML file anyway for other information. We'd really like to minimize our file accesses wherever possible, as our target machines have pretty poor specs.
Sample XML file:
[CODE=xml]
<goal>
<svgblock>
svg data here
</svgblock>
...
</goal>
[/CODE]
Storing the filepath to the image is a thought, though we have to parse the XML file anyway for other information. We'd really like to minimize our file accesses wherever possible, as our target machines have pretty poor specs.
Sample XML file:
[CODE=xml]
<goal>
<svgblock>
svg data here
</svgblock>
...
</goal>
[/CODE]
Comment