imagecopyresized problems
| From: | Brian & Shannon Windsor | Date: | Sun, 08 Sep 2002 04:42:48 +0000 |
| Subject: | imagecopyresized problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-115643@lists.php.net to get a copy of this message | ||
I'm trying to use imagecopyresized to generate a thumbnail image and then
store the image in the proper place, but I'm running into some problems.
I'm using the standard code:
$src_img =
imagecreatefromjpeg("../php/images/".$HTTP_POST_FILES['imagefile']['name']);
if (imagesx($src_img)<$max_width){
imagejpeg($src_img);
exit();
}
$dst_img = imagecreate(80,60);
imagecopyresized($dst_img,$src_img,0,0,80,60,80,60,imagesx($src_img),imagesy
($src_img));
imagejpeg($dst_img);
this will give me this output:
3ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v2.0 (using IJG JPEG v62), default quality
ÿÛC $.' ",#(7),01444'9=82<.342ÿÛC
2!!22222222222222222222222222222222222222222222222222ÿÀ
What I need is for imagecopyresized to make a new file that I can then give
a new name and copy into the files that I want it to go to, such as..
copy ($dst_img, "../php/thumbs/".$thumb_name);
If I try to this, I get the following error...
Warning: Unable to open 'Resource id #4' for reading: No such file or
directory in /u/php/uppic.php on line 55
(uppic.php is the name of the .php script this is in)
Am I missing something obvious?
Thanks,
Brian