I think this one is what you where looking for:
There is an example there of how to generate an image, only half size of original.
You can however make it generate a STATIC size of the copied image.
You do not have to STORE the image, as you can display it and then delete the temp image after it's shown to the user.
What is best to do? This depends on several factors:
* Number of visitors on your pages
* Number of hits on your pages
* How lager images you think is o.k. for bandwidth
* Your bandwidth quota
* Your HD quota
I however do not think that the sitepoint tutorial was worth any pennies or cents, as it simply adds the 'width="x" height="y"' to the <img> tag.
That is not resizing at all, and it will force the download of the original image. (it will look resized, but it's actually fullsized, almost like zoom-out).
eg. If you have some page with only one image per item, this might be interesting.. If however, you wish to show a thumb-list in a gallery, I would not do it like that, as then the images will take a considerate time to load.
I think this matter is not most of hd-space, but of bw-usage, and therefore I think it's best to generate TN_ files for each image.
You can use one file for showing images or TN_ and simply switch a function-variable.
Inside that function variable, you must remember to check if image excist.
/* here you would switch the action-variable and then retrieve either thumb or fullsize */
if (!is_file("TN_" . $image)) {
if (is_file($image)) {
createThumb($image, "TN_".$image);
}
else {
echo "404"
}
}
ps. this is psuedocode, do not take it as it is, as it would need some optimalization.
Olav Alexander Mjelde
Admin & Webmaster