Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
error: Call to undefined method Fuel\Core\Image::factory()
  • I ask if what is the problem with this here's my code

    if (Upload::is_valid())
    {
       // save them according to the config
       Upload::save();

       // call a model method to update the database
     
       $file = Upload::get_files();
       foreach ($file as $savefile) {

        var_dump($savefile);
       }
    $filepath=$savefile['saved_to'].$savefile['saved_as'];
    $width=640;
                    $height=480;
      
      Image::factory()->load($filepath) ->resize($width, $height) ->save($filepath); /* <- error */
    }
  • As the error says, there is no such method.  See the docs: http://fuelphp.com/docs/classes/image.html
  • My fuel/app/config/image.php is empty 
    The error is also the same. :(

  • What part of "that method does not exist" did you not understand?

    You get the same error if you use Image::somerandommethodthatdoesnotexist();
  • I understand a bit but not totally.
    I just don't know what to put in app/config/image.php. (newbie here :) )
  • HarroHarro
    Accepted Answer
    What goes in there or not is not a problem.

    Your code uses Image::factory(), but the Image class does not contain a method called "factory", which is why you have this error. You have an error in your code, not your config.

Howdy, Stranger!

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

In this Discussion