The AnyExamples site has a new tutorial posted that looks the creation of a "multiple photo thumnail generator".
Built-in PHP library gd does not have ready-to-use function for photo(jpeg) thumbnail generation. Although there are many such examples on the net, they are usually not suitable for effective generating series of thumbnails (240x240, 140x140, 80x80). This article provides php function thumbnail_generator and trivial image uploading script, which generates series of thumbnails.
They start with the creation of two functions, one to calculate the new thumbnail's size and the other to work to create it. They explain it briefly then move on to a useful application - a file upload that automatically creates a thumbnail for an uploaded image.