Jump to content

problem with imagecreatefromjpeg


helloise

Recommended Posts

i hasve the following 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

Link to comment
Share on other sites

imagecreatefromjpeg() is looking for Rainbow-code-1_blck.jpg in the directory your php script is in. Include the whole path like you did with file_exists():

 

$filename = "Rainbow-code-1_blck.jpg";
if (file_exists(sfConfig::get('sf_upload_dir') . '/rainbowcode/images/profilepics/'.$filename))
{
    echo "file found";
     $source = imagecreatefromjpeg(sfConfig::get('sf_upload_dir') . '/rainbowcode/images/profilepics/'.$filename);
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.