sciapp / gr

GR framework: a graphics library for visualisation applications
Other
329 stars 54 forks source link

Data URI mediatypes should be specified in svg outputs #58

Closed CommunicationAnimale closed 6 years ago

CommunicationAnimale commented 6 years ago

Currently, when GR embeds a png image in a file saved in the svg format it uses

<image width="447" height="384" xlink:href="data:;base64, ... />

However, according to the section about the syntax of data URIS on MDN, if no mediatype is specified, the default is text/plain;charset=US-ASCII. This behavior causes compatibility issues with programs such as gnome image viewer and ffmpeg.

The fix is to specify the mediatype like so:

<image width="447" height="384" xlink:href="data:image/png;base64, ... />

I can't really read C code, but it seems that this line is printed by this piece of code in the file svgplugin.cxx.

jheinen commented 6 years ago

Has been fixed in the current release.