biffbangpow / silverstripe-webp-detection
Simple detection of browser webp capabilities
Installs: 457
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Type:silverstripe-vendormodule
Requires
This package is auto-updated.
Last update: 2024-08-28 17:51:20 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)