problem with 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
helloise
Forum Commoner
Posts: 31
Joined: Tue Sep 21, 2010 4:20 am

problem with imagecreatefromjpeg

Post by helloise »

i hasve the following code:

PHP Code:
$filename = "Rainbow-code-1_blck.jpg";
if (file_exists(sfConfig::get('sf_upload_dir') . '/rainbowcode/images/profilepics/'.$filename))
{
echo "file found";
$source = imagecreatefromjpeg($filename);
}
but i get the following warning:
Warning: imagecreatefromjpeg(Rainbow-code-1_blck.jpg): failed to open stream: No such file or directory in /home/helloises/traffic_2/phoenix/plugins/rainbowCodePlugin/lib/model/RcProfileTable.php on line 168

i dont understand my file does exist...it goes in to the if cos the echo executes
please help i am new to this and have no idea how to fix this
thank you
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: problem with imagecreatefromjpeg

Post by McInfo »

The string passed to file_exists() is different from the string passed to imagecreatefromjpeg().
Post Reply