
On 2016-01-07 18:10 (+0100), Aurélio A. Heckert wrote:
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.
These types of crashes in python-based extension scripts had already been addressed earlier in trunk (and the fix backported to the stable release branch for 0.91.1) - they had been reported multiple times in the bug tracker, and are tracked for width and height separately in
https://bugs.launchpad.net/inkscape/+bug/1461346 https://bugs.launchpad.net/inkscape/+bug/1463623
Seems that we now have a double-fix committed in trunk for the same issue ;-) I'll probably better revert the fixes committed earlier - AFAICT the remaining issue which the solution in your latest commit improves is getting a more correct view-center for such documents (by falling back to viewBox values if the width and height attributes are not present).
Thanks for the clarification [1].
Regards, V