As SVGs are valid image format that can be uploaded into the Drupal system, we should be able to optimize them.
I've checked this tool: https://github.com/svg/svgo . It has has a web-accessible UI, exposing the tool.
I managed to reduce the size of an SVG with almost 40% without any loses with it.

As far as I know, this module is pluggable, so we only need to implement a plugin that reacts to SVG files being uploaded and react on them.

Comments

ndobromirov created an issue. See original summary.

tamnv’s picture

Hi @ndobromirov,

The Drupal system doesn't allow upload svgs like as image format, we can upload svgs like as a file, and display by SVG Embed module(or other way). And I think svg is web vector image, we can't reduce the quality of it, we can reduce size of svg image.

ndobromirov’s picture

Hi @tamnv,

The issue is very similar to this one, see this comment.

You can upload SVG images like so:
http://prntscr.com/90g0ft - just add the image field and allow SVG extension in the list (by default it is not enabled though).
And then display ot like this: http://prntscr.com/90g9dl

The final result on the thread here should be patch for integration for an optimizer tool(s) for SVG files to the module or a reject by a maintainer as out of scope.

BR,
Nikolay Dobromirov.

Steven Jones’s picture

Status: Active » Closed (won't fix)

Not sure how this module would support SVG, so closing, but if anyone comes up with anything, please post it!