PHP Image Adaptation for Mobile

This is very much out of date. Do not try to follow this advice!

In my previous post I talked in general terms about using client side techniques for style adaptation and server side for content adaptation. On a simple site like this, the main type of content that needs to be adapted comprises the images.

What follows is a description of the rough and ready approach I use for adapting images on the server for the mobile or desktop context. It's still work in progress and when I've cleaned it up a bit I'll update this page but it seems to work OK and I'd like to 'show my working'!

PHP version 4.3 onwards includes the GD Extension by default. To check whether your PHP build includes it, load your phpinfo() page and look for something like this:

Remaining content deleted - really, don't do this!