Smush CDN loads wrong size

When the CDN auto-resize is activated, some images are loading on the wrong size, can you help me?

  • Adam
    • Support Gorilla

    Hello idomagic

    I hope you’re well today and thank you for your question!

    The solution here is to use “Force full width” option for the image in “top bar” module “Design -> Sizing” options.

    With this option disabled, the container element doesn’t really have any specific dimensions set – it only has “maximum width allowed” set and automatic height. That means that it is sized based on its content (so the image that’s inside it – the same that CDN resizes) and within the boundaries of it’s parent elements “up the DOM tree”.

    So, when image resizing in CDN is disabled, the image inside the container “pushes” the container to full width (so maximum width allowed by CSS) because it’s big enough. When CDN resizing is enabled, CDN tries to determine that maximum size and that basically depends on parent blocks’ sizes and actual image sizes.

    When the “Force full width” option is enabled in Divi it actually sets width of the element to 100%, instead of setting it to “maximum 100% but could be smaller” – so the width “is known” and Smush is able to determine it.

    Best regards,
    Adam