Hi @awspeidel,
Sorry for the late reply!
Are you still seeing this issue? If so, is it possible for you to send me over a sample SVG (one that you’re seeing this issue with) to [email protected] please?
I’m guessing there’s something in the SVG that the sanitiser isn’t liking.
Cheers,
Daryll
Hi @awspeidel,
Thanks for sending those SVGs over.
The issue in my eyes seems to be the following:
You sent two files over, one that works and one that doesn’t.
The first file (that works) is a legitimate SVG, made up of paths etc. The sanitiser handles this very well.
The second file, whilst in an SVG file is not actually using any of the SVG functionality. Inside the SVG file is a base64 encoded PNG. Therefore you’re not actually getting any of the benefits of it being an SVG as it’s not truly a vector file.
The reason it’s not loading in WP Admin is because of this embedded image, the sanitiser expects the image to be embedded with image/png but for some reason, yours is embedded with img/png, which as far as I can see is an invalid mime type, according to http://www.iana.org/assignments/media-types/media-types.xhtml#image.
In this case, you have three real options:
- Change the mime type to use the correct version of
image/png which will then stop the sanitiser from stripping the image.
- Remove the PNG from the SVG wrapper and upload it as is. This will also allow WordPress to use it’s compression/resizing on the image as it should do
- Convert the PNG into a legitimate vector file, using something like Illustrator or Sketch, and save out the result into a proper SVG file
All of these options will fix the issue you’re having with this file.
Hopefully, that’s of some help.
Cheers,
Daryll