Hi @ashf,
Can you please send us an SVG example where we can see the difference between WP SVG Images and Safe SVG?
Thank you!
Thread Starter
ashf
(@ashf)
Plugin Contributor
kubiq
(@kubiq)
Currently it’s parsing only float numbers from width
and height
attributes, because there is no software that outputs anything else than pixels in there, or am I wrong?
I’m not sure if it’s even valid to use any relative units for svg
tag. As far as I know, there should be only specific values/units, like cm
or px
, otherwise you should use CSS to style it, or simply remove these width
and height
attributes.
Thread Starter
ashf
(@ashf)
Serif Affinity Suite(Affinity Designer) exports 100% for the width/height and it is valid according to the Serif engineer.
Safe SVG handles it properly.
Plugin Contributor
kubiq
(@kubiq)
I guess I can add some condition to simply ignore width
and height
if there is %
unit ofc…
But it’s a good idea to also optimize your SVG images, because these programs output a lot of not-needed code and the file is often many times bigger than it’s needed, eg. take a look how optimized version of your SVG looks like: https://pastebin.com/8SeMM6Sd
This can not be done automatically by the plugin, because sometime you don’t want to strip classes, ids, you don’t want to convert everything to paths, etc… so you need to setup good configuration how you need it for each SVG separately, eg. here: https://jakearchibald.github.io/svgomg/
But sure, I’ll fix this %
like I wrote in the first sentence and it will be released in next hours/days.
Thank you.
Plugin Contributor
kubiq
(@kubiq)
Hello @ashf ,
you can update to version 4.2 now and everything should work, but it will affect only newly uploaded files after this update, so old ones will be not changed unfortunately.