inkex.py: avoid ZeroDivisionError in getDocumentUnit()
Bug #1474188 reported by
su_v
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
In Progress
|
Medium
|
jazzynico |
Bug Description
Follow-up to:
Bug #1473955 Sticky zero width, height in viewBox attribute
Proposed changes (trunk, 0.91):
1) Avoid ZeroDivisionError in getDocumentUnit() if viewBox width is '0'
2) If scale factor based on width is undefined, try scale factor based on height
Todo (trunk only; to be tracked separately):
3) Support arbitrary (but uniform) document scale; don't fall back to CSS px.
Diff tested with Inkscape 0.91+devel r14244 on OS X 10.7.5.
Related branches
Changed in inkscape: | |
assignee: | nobody → jazzynico (jazzynico) |
importance: | Undecided → Medium |
status: | New → In Progress |
To post a comment you must log in.
I believe I may have a very similar bug, if not the same.
Upon saving a new *optimised* SVG Document on Windows 10 (completely unedited externally), the following message appears:
Traceback (most recent call last): inkscape. py", line 78, in <module> output= False) share\extension s\inkex. py", line 265, in affect getposinlayer( ) share\extension s\inkex. py", line 207, in getposinlayer share\extension s\inkex. py", line 351, in unittouu _uuconv[ u.string[ u.start( ):u.end( )]] / self.__ uuconv[ self.getDocumen tUnit() ]) share\extension s\inkex. py", line 326, in getDocumentUnit uuconv[ svgwidthunit] * width / viewboxwidth
File "scour.
e.affect(
File "C:\Program Files\Inkscape\
self.
File "C:\Program Files\Inkscape\
x = self.unittouu( xattr[0] + 'px' )
File "C:\Program Files\Inkscape\
return retval * (self._
File "C:\Program Files\Inkscape\
svgunitfactor = self.__
ZeroDivisionError: float division