biffbangpow/silverstripe-webp-detection

Simple detection of browser webp capabilities

Maintainers

Package info

github.com/BiffBangPow/silverstripe-webp-detection

Type:silverstripe-vendormodule

pkg:composer/biffbangpow/silverstripe-webp-detection

Statistics

Installs: 490

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.1 2021-07-28 10:52 UTC

This package is auto-updated.

Last update: 2026-02-28 21:02:58 UTC


README

Provides basic WebP support detection based on browser headers

By default, the extension is applied to SiteTree, meaning that any page class which extends this should be able to use detection in a template:

<img alt="Someimage" src="
 <% if $WebPSupport %>
   $MyImage.ScaleWidth(250).Format('webp').Link 
 <% else %>
   $MyImage.ScaleWidth(250).Link
 <% end_if %>
 ">

(Example shows the generation of a WebP image using the Image formatter module here: https://github.com/tractorcow/silverstripe-image-formatter)