Error using imagecreatefromjpeg

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
addamh
Forum Newbie
Posts: 1
Joined: Thu Aug 20, 2009 10:23 pm

Error using imagecreatefromjpeg

Post by addamh »

I've got this script that is supposed to resize an image. The first step is to create an image from the current image. Here is the code I'm using:

Code: Select all

$tmp_img = "tmp/1250822321.jpg";
$src = imagecreatefromjpeg($tmp_img);
When I do this, it gives me the error:
Warning: getimagesize(Resource id #2) [function.getimagesize]: failed to open stream: No such file or directory in /home/loseelon/public_html/admin/test.php on line 6

The image does exist, and is a valid jpeg. I've tried several images and have ensured that it is valid. The value for $src is somehow coming out to be "Resource id #2". Any ideas on what I can do to get this working?
Post Reply