Support » Plugin: Cloudinary – Image and Video Optimization, Manipulation, and Delivery » Warnings for image sizes when an SVG has been used

  • Hi,

    I am using a 3rd party plugin to allow WordPress to support SVGs. https://en-gb.wordpress.org/plugins/svg-support/

    Once the sync to Cloudinary completed everything worked. The SVG was returned and displays on the page as expected.

    The only issue is, that there are warnings appearing as Cloudinary code tries to access ‘full’ for the size.

    In class-media.php on L620 and L621 it does the following:

    ! empty( $meta['width'] ) ? $meta['width'] : $meta['sizes']['full']['width'],
    ! empty( $meta['height'] ) ? $meta['height'] : $meta['sizes']['full']['height'],

    But in the case of an SVG it will height no height and width and therefore be set to 0, so an additional check is needed:

    (!empty($meta['width']) || $meta['width'] == 0) ? $meta['width'] : $meta['sizes']['full']['width'],
    (!empty($meta['height']) || $meta['width'] == 0) ? $meta['height'] : $meta['sizes']['full']['height'],
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @designyourcode
    I’m the developer of SVG Support.

    Just wanted to chime in and say I’m hoping to add some code to my plugin that will potentially set some meta sizes based on the dimensions the svg was saved at.

    But this solution in cloudinary is probably a good idea too anyway, especially until I do update my plugin with some size handling.

    Plugin Support loic @ cloudinary

    (@loiccloudinary)

    Hi @designyourcode, @benbodhi,

    I see @designyourcode also created a ticket as well via our website.

    I have escalated the issue to my team with your suggestion and I’ll keep you posted on the action we will take.

    Hope that makes sense.
    Best,
    Loic

    Thread Starter DesignyourCode

    (@designyourcode)

    Brilliant, thank you all. @benbodhi let me know if I can be of any help as we use your plugin on a number of our sites so we can help test.

    Thanks @designyourcode I really appreciate that.
    Any chance you could please create a thread in my support forum and select “not a support thread”, just so I can have a clean one with you in case I can use your help with testing new image dimensions code? Just so we don’t have to bump this thread at a later date unnecessarily.
    https://wordpress.org/support/plugin/svg-support/#new-topic-0

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.