scour fails on some polygons/polylines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Low
|
jazzynico | ||
Scour |
Fix Released
|
Medium
|
Unassigned |
Bug Description
This fragment in an svg file will break scour:
<polygon points="-125,-75 -125,125 75,125 75,-75"/>.
Traceback reads:
scour 0.26
Copyright Jeff Schiller, Louis Simard, 2010
Traceback (most recent call last):
File "scour/scour.py", line 3183, in <module>
out_string = scourString(
File "scour/scour.py", line 2952, in scourString
cleanPolygo
File "scour/scour.py", line 2164, in cleanPolygon
pts = parseListOfPoin
File "scour/scour.py", line 2136, in parseListOfPoints
prev = nums[len(nums)-1]
IndexError: list index out of range
The Reason being, I suppose, that the list of points starts with a negative one.
I worked around with below patch, handle with care:
--- scour/scour-orig.py 2011-07-01 12:19:14.662878583 +0200
+++ scour/scour.py 2011-07-01 12:20:03.402875383 +0200
@@ -2129,6 +2129,9 @@
if j == 0:
if negcoords[0] != '':
+ # this could be the first point
+ elif len(nums) == 0:
+ nums.append( '-'+negcoords[j] )
# otherwise all other strings will be negative
else:
# unless we accidentally split a number that was in scientific notation
Changed in inkscape: | |
assignee: | nobody → JazzyNico (jazzynico) |
importance: | Undecided → Low |
milestone: | none → 0.49 |
status: | New → In Progress |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Changed in scour: | |
status: | Fix Committed → Fix Released |
Fixed in Scour revision 216. Thanks for your patch!