Scour - Cleaning SVG Files

Path simplification bug

Reported by Johan Sundström on 2011-07-24
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Scour
Undecided
Unassigned

Bug Description

Scour munges a few paths in http://en.wikipedia.org/wiki/File:Chrome_Logo.svg to look incorrect, specifically it breaks this path:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
 <path d="
 M129.408 159.229
 l-43.333 33.918
 c0 0-10.251 7.166-3.583 14.416
 c6.666 7.25 29.333 31.666 56.083 33.916
 s71-19 91-50
 s32.5-85.499-4-128.999
 c0 0 14.001 22.833 15.834 42.333
 s-1.834 7.166-19.834 1.333
 s-30.333-8.667-34.833-10.167
 s-7.042-3.5-7.667-4.063
 c0 0 7.229 22.302-0.375 37.813
 C169.2 149.104 154.741 157.479 129.408 159.229
 z"/>
</svg>

https://gist.github.com/1102020

Johan Sundström (ecmanaut) wrote :

Current output (r215), re-formatted in the same way for readability:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
 <path d="
 m129.408 159.229
 l-43.333 33.918
 s-10.251 7.166-3.583 14.416
 c6.666 7.25 29.333 31.666 56.083 33.916
 s71-19 91-50 32.5-85.499-4-128.999 14.001 22.833 15.834 42.333-1.834 7.166-19.834 1.333-30.333-8.667-34.833-10.167-7.042-3.5-7.667-4.063 7.229 22.302-0.375 37.813
 c-9.5 19.375-23.959 27.75-49.292 29.5
 z"/>
</svg>

Johan Sundström (ecmanaut) wrote :

Specifically, it tries to join

 s32.5-85.499-4-128.999
 c0 0 14.001 22.833 15.834 42.333

into

 s32.5-85.499-4-128.999
 14.001 22.833 15.834 42.333

which apparently doesn't have the same effect.

There's a tiny missed optimization opportunity in there too;

 c0 0-10.251 7.166-3.583 14.416
 c6.666 7.25 29.333 31.666 56.083 33.916

can legally omit the second "c".

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers