Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Implementing a image cropping feature: OutOfBoundsException [ Error ]: Image file does not exist.
  • Hello,

    I am implemented an image cropping feature, so I'm using the Image class extensively.

    here is the controller code for the actual crop_image method:

    and here is the controller code for the form:


    I am getting this error:
    OutOfBoundsException [ Error ]:
    Image file does not exist.

    I even tried write the actual url "/files/test-photo.jpg" in the first method. The photo IS showing up on the HTML side of things. I'm pretty sure the files directory has all the right permissions. Anyone have an idea why this error is being thrown?

    Thanks.
  • load() does an is_file() check on the filename passed, and if that fails, you'll get this exception.

    You use:
    $raw->load('/files/'.$img_path);
    are your files really in the root of your filesystem? Or did you mean a relative path based on something (which will not work)?
  • no i guess not, that url is used in the HTML mark-up tho.

    Using DOCROOT helped the app find the file 
  • I guess something in the config, was appending '/files...' to something? 
  • load() uses realpath(), so it needs a FQFN, with relative paths the results may be undefined.

    It's a path/filename you pass in your load() call, no config is involved?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion