fractalize make division zero (reproductible case)

Bug #168759 reported by Popolon2
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Unassigned

Bug Description

With today SVN version of Inkscape

Open the attached file :

launch the fractalize script with parameters :
Subdivisions : 6
Smoothness : 4.0

This error log is displayed (ZeroDivisionError) :

Traceback (most recent call last):
  File "/opt/gfx/inkscape-cvs/share/inkscape/extensions/fractalize.py",
line 89, in <module>
    e.affect()
  File "/opt/gfx/inkscape-cvs/share/inkscape/extensions/inkex.py", line
153, in affect
    self.effect()
  File "/opt/gfx/inkscape-cvs/share/inkscape/extensions/fractalize.py",
line 71, in effect

self.fractalize(a,x1,y1,x2,y2,self.options.subdivs,self.options.smooth)
  File "/opt/gfx/inkscape-cvs/share/inkscape/extensions/fractalize.py",
line 79, in fractalize
    subdivPoint = calculateSubdivision(x1,y1,x2,y2,f)
  File "/opt/gfx/inkscape-cvs/share/inkscape/extensions/fractalize.py",
line 30, in calculateSubdivision
    nx = -y3/length
ZeroDivisionError: float division

Tags: extensions
Revision history for this message
Popolon2 (popolon2) wrote :
Revision history for this message
Popolon2 (popolon2) wrote :

Originator: YES

working solution,
replace :
      nx = -y3/length
      ny = x3/length

By
    if length != 0:
      nx = -y3/length
      ny = x3/length
    else:
      nx = 1
      ny = 0

(use attached patch)

File Added: fractalize_divzeo.patch

Revision history for this message
Bryce Harrington (bryce) wrote :

If this is still an issue, we should incorporate this patch for 0.46.

Changed in inkscape:
importance: Undecided → High
milestone: none → 0.46
status: Fix Committed → In Progress
Revision history for this message
Popolon (popolon) wrote :

I have already fixed and commited in svn, (there was the fixed/commited status) I put it back to this state

Revision history for this message
Popolon (popolon) wrote :

move to fix released, sorry for the error in this tracker usage

The revision of the commit :
http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/share/extensions/fractalize.py?revision=15372&view=markup

Changed in inkscape:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.