SVG-Optimiser icon indicating copy to clipboard operation
SVG-Optimiser copied to clipboard

Mediawiki's FClef gets broken by optimiser

Open ydirson opened this issue 12 years ago • 2 comments

The svg at http://commons.wikimedia.org/wiki/File:FClef.svg has translation transforms (unlike their GClef one which is perfect, go wonder ;), and applying current SVG-Optimiser (201589e0b) produces a broken result.

ydirson avatar Feb 17 '13 20:02 ydirson

Thanks for bringing this to my attention. I'm in the middle of trying to fix how the program works with paths. In the meantime, here's an optimised version of the SVG you sent:

<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" width="18" height="20">
 <path d="M17.3 3.1C17.3 3.5 17.2 3.9 16.9 4.1C16.5 4.5 16 4.5 15.5 4.4C15.1 4.2 14.7 3.7 14.7 3.3C14.7 2.9 14.8 2.5 15.1 2.2C15.3 2 15.7 1.8 16.1 1.8C16.5 1.9 16.8 2 17.1 2.4C17.2 2.6 17.3 2.9 17.3 3.1z"/>
 <path d="M17.3 9C17.3 9.4 17.2 9.7 16.9 10C16.5 10.3 16 10.4 15.5 10.2C15.1 10 14.7 9.6 14.7 9.1C14.7 8.7 14.8 8.3 15.1 8.1C15.3 7.8 15.7 7.7 16.1 7.7C16.6 7.7 17 8 17.2 8.5C17.3 8.6 17.3 8.8 17.3 9z"/>
 <path d="M13 7.2C13.1 10 11.8 12.8 9.8 14.7C7.3 17.2 4.1 18.8 0.7 19.9C0.3 20.1 -0.4 19.8 0.3 19.5C1.7 18.9 3.1 18.3 4.3 17.5C7 15.8 9.3 13.2 9.9 10C10.2 8 10.1 5.9 9.6 4C9.2 2.6 8.3 1.1 6.7 0.9C5.3 0.7 3.8 1.2 2.8 2.2C2.5 2.5 2 3.2 2.1 4.1C2.7 3.6 2.7 3.7 3.1 3.4C4.3 2.9 5.8 3.7 6.1 4.9C6.4 6.1 6.1 7.5 5 8.1C3.8 8.8 2.1 8.5 1.4 7.2C0.3 5.3 0.9 2.6 2.7 1.3C4.5 -0.2 7.1 -0.3 9.2 0.5C11.4 1.3 12.7 3.6 12.9 5.8C13 6.3 13 6.7 13 7.2z"/>
</svg>

It could actually be improved further by replacing the code for the circles with circle elements, but it's hard to automatically detect when a shape is essentially circular.

petercollingridge avatar Feb 20 '13 14:02 petercollingridge

On Wed, Feb 20, 2013 at 06:17:22AM -0800, Peter Collingridge wrote:

Thanks for bringing this to my attention. I'm in the middle of trying to fix how the program works with paths. In the meantime, here's an optimised version of the SVG you sent:

Thanks, I had optimized it using inkscape in the meantime - the process is only hardly documented and can be tedious for more complicated images, but it was workable here :)

Note, the mediawiki CClef has a similar structure, you may want to check that one too.

Best regards,

Yann

ydirson avatar Feb 20 '13 19:02 ydirson