• Resolved jan.holpuch

    (@janholpuch)


    I have turned on saving images to .webp format and in some parts of the template I get webp instead of the original jpg. Which is fine, this is what I wanted, but unfortunately it’s only somewhere.

    It seems to me that the webp files are correctly returned by the wp_get_attachment_image function, but no longer by wp_get_attachment_image_url.

    Is this just a feature of the plugin or is there some way around it?

    • This topic was modified 1 year, 1 month ago by jan.holpuch.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    I have the asked the development team about this and we will update you shortly.

    Thank you for your patience. Whether or not WebP images are returned depends on the HTML rather than a function. If your site is capable of redirections, then any request to a JPG/PNG will be redirected to a WebP. If not, then the HTML is modified to point to the WebP image.

    If on some occasions WebP images are displayed but not on others, then it’s likely that not all images have been converted to this format, which can be caused by some of the images being compressed before the option to enable WebP was used.

    Thread Starter jan.holpuch

    (@janholpuch)

    Thank you very much for the information.
    So if I understand correctly, the replacement of .jpg -> .webp is done at the .htaccess level?

    It seems to me that the rule works well for elements, but not for links to jpg images or for images used as backgrounds of other elements.
    I tried to demonstrate specific behavior here: https://knihovna-hranice.cz/wepb/

    For direct links to images, processing the link via JavaScript, for example, into a lightbox, is possible, and the rewrite mode won’t catch it. It doesn’t necessarily have to be detrimental; displaying the original .jpg image can actually be useful.

    On the other hand, it’s a pity for backgrounds; there, using a compressed image would be beneficial.

    I use your plugin on all my websites, and I think resolving this “shortcoming” in some future update would make not only me happy.

    Thank you in advance and greetings!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using .webp images in template’ is closed to new replies.