scour-project / scour

Scour - An SVG Optimizer / Cleaner
Apache License 2.0
757 stars 61 forks source link

[featureRequest] remove duplicate clipPath #273

Open JoKalliauer opened 3 years ago

JoKalliauer commented 3 years ago

both.svg.txt contains several duplicate useless clipPath (>100KB), I would like to merge them

input

  <clipPath id="f">
   <path fill="#000000" stroke="none" d="M -5.44 -5.63 L 5.43 -5.63 L 5.43 5.62 L -5.44 5.62 Z"/>
  </clipPath>
  <clipPath id="g">
   <path fill="#000000" stroke="none" d="M -5.44 -5.63 L 5.43 -5.63 L 5.43 5.62 L -5.44 5.62 Z"/>
  </clipPath>
  <clipPath id="h">
   <path fill="#000000" stroke="none" d="M -5.44 -5.63 L 5.43 -5.63 L 5.43 5.62 L -5.44 5.62 Z"/>
  </clipPath>
  <clipPath id="i">
   <path fill="#000000" stroke="none" d="M -5.44 -5.63 L 5.43 -5.63 L 5.43 5.62 L -5.44 5.62 Z"/>
  </clipPath>
  <clipPath id="j">
   <path fill="#000000" stroke="none" d="M -5.44 -5.63 L 5.43 -5.63 L 5.43 5.62 L -5.44 5.62 Z"/>
  </clipPath>

output

  <clipPath id="f">
   <path fill="#000000" stroke="none" d="M -5.44 -5.63 L 5.43 -5.63 L 5.43 5.62 L -5.44 5.62 Z"/>
  </clipPath>

Copyright

source: https://commons.wikimedia.org/wiki/File:India_roadway_map.svg

author: CC-by-sa PlaneMad/Wikimedia

license: CC BY SA 3.0