I have a bit of code that uploads an image to the server. I would like to take this image and create a thumb, normal, large image from it. This is some sample code I have, but I am stuck on the saving part of the image. How do I save an image that I create to a file?
Thanks
<?php
header('Content-type: image/jpeg');
$filename="downloads/Image/large/21-47-110-1.jpg";
$img_temp = imagecreatefromjpeg($filename);
$img_thumb=imagecreatetruecolor(132,99);
imagecopyresampled($img_thumb,$img_temp,0,0,0,0,132,99,imagesx($img_temp),imagesy($img_temp));
imagejpeg($img_thumb, "", 60);
//this is the bit I am not sure about.
$handle = fopen("downloads/Image/large/test.jpg", "a");
fwrite($handle, $img_thumb);
fclose($handle);
imagedestroy($img_thumb);
?>