ClassicPress PetitionsClassicPress Petitions
This is a read-only archive. Post or comment on the live version of this page on our forums.

Support for webP format

January 4, 2019 · 19:45 · Anonymous
Description

Hi, I like me suggest support for webP, Opera, Android, Chrome and Yandex (and browsers based in Chorme) support webP and the last beta version of Firefox support webP too.

Thanks

Voters
+10 more
Discussion
Greg Schoppe

To support this properly, we'll need to modify how images in content work. The existence of modern media formats with fallbacks proves that it's important that external resources not be embedded in static and fragile ways.

Perhaps image tags in content could be replaced by an image shortcode, which renders based on image ID and a set of attributes. That way, on render the image would get pulled in with wp_get_attachment_image(), allowing various plugins to filter the output, based on context.

This would also serve to allow other plugins to modify the output, making blur-in lazy-loading (as seen on Medium) and other image enhancements significantly easier.

James Nylen

> To support this properly, we'll need to modify how images in content work. [...] Perhaps image tags in content could be replaced by an image shortcode, which renders based on image ID and a set of attributes.

I really like this idea. It would also eliminate or significantly reduce the problems with renaming an image that is linked from existing content.

Fabian Wolf

Heh ... Using a shortcode for this is quite similar to what I've been doing for a while - but both with images AND links; because as soon as URLs change, all goes "boom". That eg. happens when moving content from one system to another, ie. from the development to the live system. Thus, [permalink] and [attachment] shortcodes ..
.. the nice side effect of corpse is indeed being able to extend the image insertion, eg. for adaptive images instead of the ugly srcset + sizes orgy, and so on.

Thus I'm all in for a "native" CP shortcode / embed shortcode for WebP and the likes :)

cu, w0lf.

Greg Schoppe

I agree that links and self-hosted embedded content are also ripe for a shortcode-like overhaul.

I like this solution because we could easily release a plugin that would add support for these shortcodes to older versions of CP/WP, and since they are using an existing technology, it would be a very low-impact retrofit.

The most complicated bit would be making the interface look good, using something like the existing gallery interface to hide the shortcode and show a pretty visual representation of the image/link/embed.

George L.

I came across these instructions https://gulshankumar.net/how-to-serve-webp-format-images-in-wordpress/ Apart from the server changes (that can be challenging for some people who don't have full access), it seems quite straight-forward.

Greg Schoppe

That tutorial shows how to get webp stored in your media library, but it doesn't touch on image manipulation, thumbnail generation, creating fallback pngs, and generating the code to output webp.

All these things are definitely doable (webp support in GD is apparently really good... Imagick, not so much), but will take a lot more code than is shown there.

George L.

Appreciate this petition is for a complete feature, but even a basic integration where the images are generated using a separate plugin or elsewhere could be a good first step.