Last modified: 2006-03-02 02:55:30 UTC
In SVG files created by Visio 2003 the width/height of the image are specified in inches, and the values are specified in floating numbers. The function wfScaleSVGUnit on the other hand, which is responsible for translating the width/height strings which appear in the SVG file (and may be of various units) doesn't support floating numbers. It therefore assumes that the values are in pixels, thus returning an invalid value (usually extremely small - few pixels). The fix is to replace the regular expression which is used by wfScaleSVGUnit on line 1663 to '/^(\\d+\\.*\\d*)\\s*(em|ex|px|pt|pc|cm|mm|in|%|)$/'
Created attachment 1425 [details] SVG file created by Visio 2003
Seems to work fine; wfScaleSVGUnit already expects and works with floats. The given file contains: width="1.2011in" height="1.2011in" and we get back what appears to be the correct size given the SVG definition of 1in as 90.0 units: > return wfGetSVGSize("/Users/brion/Desktop/shape.svg.xml"); array(4) { [0]=> float(108) [1]=> float(108) [2]=> string(3) "SVG" [3]=> string(24) "width="108" height="108"" } However it can't be uploaded to MediaWiki; I think the <script> element is triggering the standard HTML safety filter. That would be a separate bug if you wish to open a report for it.