orchestral/imagine

Class 'App\Http\Controllers\Imagine' not found

Closed this issue · 7 comments

I added the example code to my existing ImagesController.


    public function create_thumbnail($path, $filename, $extension)
    {
        $width  = 320;
        $height = 320;
        $mode   = ImageInterface::THUMBNAIL_OUTBOUND;
        $size   = new Box($width, $height);

        $thumbnail   = Imagine::open("{$path}/{$filename}.{$extension}")->thumbnail($size, $mode);
        $destination = "{$filename}.thumb.{$extension}";

        $thumbnail->save("{$path}/{$destination}");
    }

Also i added

use Imagine\Image\Box;

use Imagine\Image\ImageInterface;

i followed all steps carefully installed 3.0 for laravel 5.0 im using.

you need to include following as well:

use Imagine;

Wow so easy, great support thanks!

Could this be added to the 'README.md' file?
And maybe also a note that the config folder in Laravel 5 by default is ROOT/config/ and not ROOT/app/config/

Would appreciate it. Thanks for the nice package!

Adding use Imagine is something that you have to get used with working on namespaced project.

When i want to add it to a command for example, i then cannot use just use Imagine right?

It depends where you're working under any namespace, recommend to read up a bit on PHP namespacing.

thanks for sharing the issue