• Hello guys,

    I need to change the current placeholder (data:image/svg+xml,%3Csvg%20xmlns=’https://www.w3.org/2000/svg’%20viewBox=’0%200%201%201’%3E%3C/svg%3E) to a similar data, but with a viewbox with size of image, like “0 0 widthimage heightimage”.

    This is to maintain the aspect ratio of the image in the placeholder.

    Is it that possible? I tried to modify the plugin on Image.php where the function of the placeholder is, but I don’t have success.

    Any thoughts about it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor WP Rocket

    (@wp_rocket)

    Hi,

    It’s not something easy to do yet, but we plan to add this automatically in the plugin for images we can detect the width and height.

    Thread Starter RodSaurio

    (@rodsaurio)

    That would be great. Because now, if the placeholder is a square and the image is landscape or portrait orientation, when you scroll fast the page become a weird experience (the images show like jumping).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Placeholder with the same size of image’ is closed to new replies.