Smush CDN resizing issue

I am trying to optimize my site for speed as it’s quite heavy (photography portfolio). I keep getting 0% score on GTMetrix for serving scaled images. I’ve used smush pro to compress images and enabled the CDN hoping to resolve this.
After further investigation, I’ve found that Smush CDN generates srcset with different image sizes, but image tags in my gallery have width and height attributes set to the width and height of the original image, it picks the biggest size from the srcset.

https://monosnap.com/file/jcnxT1U5AZaAeU0nUpuixZcNeAxXPg

Unfortunately, I couldn’t get rid of the width and height attributes as they’re generated automatically. Is there any way to fix this?

  • Kris Tomczyk
    • Ex Staff

    Hi Maher

    Hope you are doing good today.

    Smush CDN might no be working properly if the page builder applies certain settings/attributes to the images. In your case you use “Salient WPBakery Page Builder” where you can set up Image size attribute in this grid module.

    I made some additional test with this module and it is looks like when you have enabled Bypass Image Cropping attribute it skip Image size attribute. So value 500×500 is not apply.
    [attachments are only viewable by logged-in members]

    When Bypass Image Cropping attribute is disabled, Image size is apply correct and then issue on Gtmetrix does not exist any more.
    [attachments are only viewable by logged-in members]

    Only issue which stay then, is that this Masonry grid does not look the same. But all this is related to Bypass Image Cropping attribute.

    As you can see, in above Gtmetrix score, Smush resizing feature works correct, but it cannot force page builders to not apply a certain setting/attribute for the images.

    I reverse settings I test (enabled back Bypass Image Cropping).
    Please test once again on your side.

    Hope this help.
    Kind Regards,
    Kris