
On 06-01-2016 21:58, su_v wrote:
Would you mind sharing a test case and steps to reproduce? Which extensions fail without the commit, and how exactly?
Sure!
A designer send me many SVGs with this header: <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1171.9 593" enable-background="new 0 0 1171.9 593" xml:space="preserve">
You may noticed the missed width and height definition. That crashes getDocumentUnit() at inkex.py because *svgwidth* become *None*. The getposinlayer() also have a problem trying to read undefined height from documentRoot.
That should crash third part extensions on the world (/like local garbage here/), as it directly crashes the official extractimage.py and plotter.py. There is a non direct call of getDocumentUnit() and getposinlayer() by all inkex based extensions, so I can say that missed attributes on documentRoot is crashing all extensions on getDocumentUnit(), because it is called by affect(), the mandatory extension method.
I do have a merge proposal pending (for review) for document-scale related issues [1], and would appreciate any further test cases which possibly are not handled correctly yet with the proposed changes for retrieving the document scale.
I hope this 2¢ helps. :-)
Cheers!
Regards, V
[1] https://code.launchpad.net/~inkscape.dev/inkscape/extensions-svgunitfactor/+...
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel