Add Webp support

#1

Hi, I was wondering if we could add webp support to the image processing?
Would you be open to a PR with this? maybe smth with {{myImage type=image format=webp}}(which would require changing the tag with <picture />) or {{myImage type=image format=webp tag=false}} to enable to use it where needed.

#2

@walidvb: Vapid already supports the uploading and resizing of WebP. Or rather, the type=image directive supports JPG, PNG, and WebP images.

As for using it in the context of the <picture> tag, I agree, using the tag=false option is the best route. e.g.,

<picture>
  <source media="(min-width: 600px)" srcset="{{photo type=image width=1000 tag=false}}" />
  <img src="{{photo type=image width=500 tag=false}}" />
</picture>
1 Like
#3

I guess I meant processing uploaded images to webp.
Currently one can resize images, which is great, but I thought we could add converting to webp to the pipeline?

#4

Ah, I see. Sorry, I misunderstood.

Yeah, I’d be open to PR. My only suggestion/preference would be to name the option output or something instead of format.

1 Like