Forum

Thread tagged as: Question

element with webp

I was reading this:

https://docs.grabaperch.com/perch/content/templates/how-do-i-use-responsive-images-in-perch/

and saw a reference to webp however the image does become "garbled" so is this due to PHP support or lack thereof?

I would like to create a template that would support the following output:

<picture>
<source srcset="image.webp" type="image/webp">
<img src="image.jpg" alt="">
</picture>

so that supporting browsers will choose it over the <img> element but it would degrade perfectly fine on non-supporting browsers.

If anyone has any ideas or information that would be great.

P.S my PHP version is 7.0.13

Garth Holmes

Garth Holmes 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

WebP support in PHP was pretty much unusable when we last looked at it. We periodically revisit the subject, but if you need to use WebP files you'll need to manually resize them in a supporting tool.

Hi Drew,

I managed to create a template, and it's working in Chrome but in relation to PHP, are you saying there is no way to display a WebP image in Perch as a Thumbnail, in order so that content editors don't get confused?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Support for resizing WebP images in PHP is not good enough for us to be able to implement it in Perch yet.