How to serve different thumbnails/images depending on users browser/platform

This is a general question to discuss approaches to filtering WordPress image sizes based on the browser/platform (such as a smart phone or netbook or desktop). The idea being that on a mobile we don’t want to force people to download a 100kb image when a 20kb one would be big enough for their screen, thus saving them and yourself, bandwidth.

The outcome would be to make using CSS media queries a viable alternative to a separate theme for a mobile version of a site.

Read More

There are a few points to consider:

User Interface

What would be the best way to allow a user to control the thumbnail and medium image sizes etc… for different platforms or indeed just for different screen sizes?

Device Detection

What would the best way to detect the device/UA’s screen capabilities on the server side. Are there any plugins that do this already?

Implementation

How would you go about writing the code to create the different thumbnails, and then to alter WPs output according to the device / screen size? Ideally this would be theme agnostic so a call to the_post_thumbnail('medium') would return the appropriate size of image for the device/platform.

Related posts

Leave a Reply

1 comment