junaidbhura / auto-cloudinary

Super simple Cloudinary auto-upload implementation for WordPress.
https://wordpress.org/plugins/auto-cloudinary/
MIT License
41 stars 9 forks source link

Automagically webp? #40

Closed djmtype closed 3 years ago

djmtype commented 3 years ago

Is there a way to return webp images using the "Automatically use Cloudinary for all images" setting in the plugin?

Otherwise, what's the suggested method of returning WebP images?

Within cloudinary.com > settings > upload, under Default image quality, I chose the JPEG 90, WebP 75, JPEG-XR 80 setting, thinking that might do it. But nope.

djmtype commented 3 years ago

BTW, I added this filter to my functions, but no webp returned :(

add_filter( 'cloudinary_default_args', function ( $args ) {
    $args['transform']['fetch_format'] = 'auto';
    return $args;
} );
djmtype commented 3 years ago

Sorry, I see the webp type now. It can be seen in dev tools as Type or under the Response Headers tab.