Q:

Php Imageresize Performance

I'm working on an image resize script for php, and had a few questions..
Currently I'm pulling an external URL as the image, and don't really want to store the new image that is going to be re-sized on my server.   Here is what I'm trying to do:
Have the script resize the image, than encode it the resized image in base64 on the fly.   Now what I'm wondering is, would this be heavy on performance both doing the encode, and serving up the image with base64 rather than just the url?  or would it be better to store the image rather than to store the base64 code for it? 

A:

Why are you encoding the resized image?  Why not just output it directly.  You don't need to save it to a file.  
Some relevant lines from php function page:
// Content type
header('Content-type: image/jpeg');

// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

// Output
imagejpeg($thumb);

To include it in the page you would do something like:
<img src="resizer.php?url=[encoded url here]" />

