This is cheating, any idiot can modify the IMG tag width and height attributes. What I was looking for was a PHP script that would actually generate a new image at the requested resolution. Though to be fair you do say this at the bottom. Unfortunately this article came up as the first hit on my google search

Maybe I'm also going to use the 'getimagesize' function - but what I would like is that it only shows the 10 newest images from a folder - is this possible? Or that it shows randomly 10 pictures out of a folder... Appreciate any hints.

A big problem here is that you are loading the entre image, and incurring the bandwidth for it as well, when you could just be loading a thumbnail image that is a fraction of the size. Why load an 80kb image when you only need to load a 5kb image?

This is for craig34 YOu are correct however if the image is a hyperlinked thumbnail of the original and you have over 3000 images it is great. Having to resize all images (which takes up server space) and have it load two images...This is beter.

Thank you Greg Knox

The function can be rewritten for nonpercent values and different value for width and height

I tried the above article out, but found that it was not working that well for me. I've included an updated script that works really well for me. By the way, forgive me by the messiness of the code - I was in a rush!

Haha. To resize the image and make it a smaller filesize, use a free program like "Irfanview". You can choose to resample the image for better quality, and compress the image at varying percentages to achieve truly miniscule filesizes!