serbanghita / Mobile-Detect

Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
http://mobiledetect.net
MIT License
10.55k stars 2.68k forks source link

WebP image support #828

Closed wmertens closed 3 years ago

wmertens commented 4 years ago

it would be great if the result could include if the device probably supports WebP images.

I'd like to send more optimized images but not all browsers support .webp and now I have to do the support client-side in javascript.

If I know in advance that .webp is probably supported, the browser doesn't have to download .jpg at all, even if javascript isn't loaded yet.

Basically, only IE and Safari don't support it

serbanghita commented 3 years ago

The script cannot detect the viewport, pixel density or resolution of the screen since it's running server-side.

From https://github.com/serbanghita/Mobile-Detect/blob/master/docs/KNOWN_LIMITATIONS.md