Closed sejas closed 2 weeks ago
@sejas just to make sure – does this work in regular WordPress?
Yes! I tried it in a regular WordPress without plugins and it worked without any issues.
From the "Using WebP images" section of the WP WebP announcement post:
In WordPress, the lossless WebP format is only supported when the hosting server uses Imagick (the PHP library) until LibGD adds support.
It looks like libgd ought to support webp now based on https://github.com/libgd/libgd/pull/698 merging.
But Playground doesn't appear to support webp. From the Playground WP-CLI demo:
$ wp eval 'var_dump(array_search( "gd", get_loaded_extensions() ) );'
int(13)
$ wp eval 'var_dump(wp_image_editor_supports( array( "mime_type" => "image/webp" ) ) );'
bool(false)
In Playground, PHP loads the "gd" extension, but WP doesn't think the image editor supports webp. Some possibilities:
This is now resolved for PHP >= 7.4, but not for 7.0 – 7.3. How important is webp support in these version for you @sejas?
Thank you for fixing the webp issue for PHP 7.4+. You are Awesome!
The main reason we don't need to support older versions is that PHP 7.4 and even 8.0 are already deprecated. Versions lower than 7.3 do not appear in the chart 😆.
Some Studio users reported an error uploading
webp
images to the Media Gallery.Steps to reproduce:
This image cannot be processed by the web server. Convert it to JPEG or PNG before uploading.
Workaround
1.webp
to1.jpg
in your computer.webp
extensionScreencast
https://github.com/WordPress/wordpress-playground/assets/779993/e8e3f6d3-e54c-4fcf-8ed9-1a7f3b72681f