• Resolved mattiasf

    (@mattiasf)


    How do I return webp images? E.g. I am using wp_get_attachment_image_srcset but the WEBP image is not being returned. Using wp_get_attachment_image_src doesn’t retrieve it either.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Hai Zheng?

    (@hailite)

    WebP don’t have special hooks currently. You can append .webp to the image filename and detect if the file exists or not to retrieve it.

    Thanks.

    Thread Starter mattiasf

    (@mattiasf)

    OK, @hailite how does it fallback to .jpg for unsupported browsers?

    Would be great if it would work out of the box, just like, say a CDN does. When I use wp_get_attachment_image_src to retrieve an image, the CDN url (if activated) is automatically retrieved.

    Thread Starter mattiasf

    (@mattiasf)

    Also I noticed this setting: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media#webp_for_extra_srcset – but in my srcset, there is no webp image.

    Also I tried appending the .webp image, but it is not found on the server. If I go to the media attachment, I see no button to “generate” or “compress” image. How can I compress the image, and generate webp as well?

    The image is old, so the cronjob should have finished by far. I see a lot of images that are not compressed, and I’d like some button to compress them.

    Plugin Support Hai Zheng?

    (@hailite)

    There is no manual send request per image in Media list yet. Its in our todo.

    The way it fallback to .jpg for unsupported browser is bcos LiteSpeed cache supported vary to make multi copy of cache. Supported browser has a different cache copy than unsupported ones by vary.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to retrieve webp images?’ is closed to new replies.