If you are using the .php file directly, you must be sure that nothing else is sent to the browser from the PHP file (text for example), that would keep it from being read as an image. You can link it the same way you would link any other graphic:
You can also save the image through the imagejpeg () function (or gif or png.) Below is an example of how you would do this:
This code saves the thumbnailed file onto your server as whatever you specified($save). You can then call this new graphic file directly, and do not need the PHP again once the image file has been created.
//Name you want to save your file as $save = 'myfile.jpg';
$file = 'original.jpg'; echo "Creating file: $save"; $size = 0.45; header('Content-type: image/jpeg') ; list($width, $height) = getimagesize($file) ; $modwidth = $width * $size; $modheight = $height * $size; $tn = imagecreatetruecolor($modwidth, $modheight) ; $image = imagecreatefromjpeg($file) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; // Here we are saving the .jpg, you can make this gif or png if you want //the file name is set above, and the quality is set to 100% imagejpeg($tn, $save, 100) ; ?>