wout/raphael-svg-import — Issue #10: raphael-svg-import: Issue for "image" on IE / VML-Mode
Author: typoworx-de
Created: 2011-12-23 14:51:53+00:00
State: open

I was trying to use raphael-svg-import to load SVG-Data into Raphael to be available in modern browsers using SVG and for the IE transformed as VML.

I noticed that there is a major issue in rendering an image for IE (VML-Mode). My background-image got rendered as black-shape! I figured out that this issue is caused by raphael-svg-import.

FILE: raphael-svg-import.js
------------------------------------------

Your lib defines a default fill-color for EVERY VML-Element on LINE 24ff which blocks IMAGE-Rendering for VML!
------------
var shape, style,
attr = { 'fill':'#000' },
node = RegExp.$1;

LINE 65ff:
-------------
case 'image':
shape = this.image();
// BUGFIX by TYPOWORX
attr.fill = ''; // THIS NEEDS TO BE CLEARED!
break;
---------------------------------------

END

There's another issue: The SVG-Image needs to be set using the Attribute "src" in the SVG-Data. InkScape (and some other tools) use the Attribute "xlink:href" instead of "src" for the Image-URL.

Please update this in your version.