Created on 30 March 2023, over 1 year ago

Problem/Motivation

The WebP β†’ module does a good job creating next-gen format (.webp) versions of images, but they are only displayed on responsive images. It would be nice to add support to this module if they have been generated.

Steps to reproduce

Apply the patch after enabling the WebP module and running `drush if --all` and clearing your cache.

Proposed resolution

See patch, code taken from WebP module and modified slightly.

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States komejo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @komejo
  • πŸ‡ΊπŸ‡ΈUnited States komejo
  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States johnny5th

    Thanks for the patch komejo. I'm not against this idea, but I think there's a fundamental problem with this implementation.

    1. There's an efficiency issue for sites without the webp module. You should check that the webp module is enabled before running the extension checks.
    2. If webp images are available, you're not leaving any fallbacks incompatible browsers. You might check out either using a @supports block, or maybe even using an image-set as a source if all browsers that support image-set also support webp: https://developer.mozilla.org/en-US/docs/Web/CSS/image/image-set
  • πŸ‡ΊπŸ‡ΈUnited States komejo

    Ah, excellent feedback - I'll see if I can find the time to make a better patch!

Production build 0.71.5 2024