• Resolved awspeidel

    (@awspeidel)


    This is an odd problem, potentially.

    We have SVG images on our site that are working just fine. All the ones currently in the image carousel (under Who We’ve Worked With) were uploaded by the person who put the site together (outside contractor, not me).

    When I try to upload new SVGs which I have created myself through Photoshop, they upload as blank images and display as such in both the media library and on the page.

    Any suggestions as to how to fix it? I’ve updated the plugin and it continues.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Daryll Doyle

    (@enshrined)

    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

    Plugin Contributor Daryll Doyle

    (@enshrined)

    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 https://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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Images Uploading Blank’ is closed to new replies.