Skip to content

Violet88github/silverstripe-webp-detection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Simple extension for detecting WebP support in a browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%