├── images ├── clear_pixel.png ├── puppy_128x96.jpg ├── puppy_320x240.jpg ├── puppy_640x480.jpg ├── puppy_960x720.jpg └── puppy_1280x960.jpg ├── README ├── demo.html └── getimage.php /images/clear_pixel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craig552uk/getImage/HEAD/images/clear_pixel.png -------------------------------------------------------------------------------- /images/puppy_128x96.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craig552uk/getImage/HEAD/images/puppy_128x96.jpg -------------------------------------------------------------------------------- /images/puppy_320x240.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craig552uk/getImage/HEAD/images/puppy_320x240.jpg -------------------------------------------------------------------------------- /images/puppy_640x480.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craig552uk/getImage/HEAD/images/puppy_640x480.jpg -------------------------------------------------------------------------------- /images/puppy_960x720.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craig552uk/getImage/HEAD/images/puppy_960x720.jpg -------------------------------------------------------------------------------- /images/puppy_1280x960.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craig552uk/getImage/HEAD/images/puppy_1280x960.jpg -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Simple image library for serving up image files at different resolutions. 2 | Useful for serving images for responsive websites. 3 | 4 | Author: Craig Russell 5 | Email: craig@craig-russell.co.uk 6 | Web: www.craig-russell.co.uk 7 | Copyright: Puppy Image (c) 2009 Craig Russell 8 | Source (c) 2011 Craig Russell 9 | 10 | - HOW TO USE - 11 | 12 | Image files are defined in the $images array like 13 | 14 | $images['id']['scale'] = "file"; 15 | 16 | id A URL safe identifier for the image 17 | scale A percentage scale of the image file 18 | 100 is fullsize image 19 | 0 is default image 20 | Define as many intermediate images as you want 21 | file The name of the image file 22 | 23 | Images are reqested like 24 | http://localhost/getimage.php?id=html5logo&scale=100 25 | -------------------------------------------------------------------------------- /demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 22 | 23 | 40 | 41 | 42 |
43 | Puppy asleep with a shoe 44 |

Loads image appropriate to browser width. Narrow the browser and refresh.

45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /getimage.php: -------------------------------------------------------------------------------- 1 |