I'm not sure as gd crashes my machine, but
you need to open the image first and assign a pointer to it...
<?
$new_w=100;
$new_h=100;
header("Content-type: image/gif");
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromGif("./imgtest.gif");
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
ImageGif($dst_img);
?>
ooorrrrrrrrrrrrrr
<pre>
$src_img = imagecreatefromjpeg($imagefile);
$new_w = imagesx($src_img)/4;
$new_h = imagesy($src_img)/4;
$dst_img = imagecreate($new_w,$new_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
imagejpeg($dst_img, "scratch/$imagefile");
echo "<img src=scratch/$imagefile>\n";
</pre>
Sparky wrote:
Here my problem, I need to be able to have someone upload an image via web form and then have a script that will take the image, resize it and display it without needing to save it. I have it working all up to the point of needing to resize it, I'm trying to use the ImageCopyResize() function but it keeps giving me the following error: "Warning: Unable to find image pointer". Please can somebody give me some advice? BTW: I'm running on PHP 3.0.14.
Regards,
Sparky