I am unable to make images. I get the following message:
Symfony Component Debug Exception FatalErrorException
Call to undefined method InterventionImageFacadesImage::make()
open: /Users/Sites/gcfs/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php
I am running InterventionImage 1.6.2
A code example would help
$image = Image::make('https://avatars2.githubusercontent.com/u/1119714?s=140');
I was reading somewhere that I might have to rename the facade? Is that correct?
Are you using a custom namespace? Or is it simply within say a route?
Route::get('foo', function() {
$image = Image::make('http://placehold.it/500x500/000/e8117f');
return Response::make($image->encode('jpg'), 200, ['Content-Type' => 'image/jpeg']);
});
pop that in your routes file and give it a go
It is in a controller. I tried added the route you have specified for debugging, but get the same message. Here is the message from the error log:
[2014-04-16 07:33:50] local.ERROR: exception 'SymfonyComponentDebugExceptionFatalErrorException' with message 'Call to undefined method InterventionImageFacadesImage::make()' in /Users/ndelja/Sites/gcfs/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:208
Stack trace:

Strange, just to confirm you have definitely done the full install? http://image.intervention.io/getting_started/laravel
Laravel 4 Integration
Intervention Image has optional support for Laravel 4 and comes with a _Service Provider and Facades_ for easy integration. After you have installed the Image class correctly, just follow the instructions.
Open your Laravel config file config/app.php and add the following lines.
In the $providers array add the service providers for this package.
'Intervention\Image\ImageServiceProvider'
Add the facade of this package to the $aliases array.
'Image' => 'Intervention\Image\Facades\Image'
That is correct. I have the config configured correctly. Everything was working in the application about 7 months. I just got back to redeveloping and ran composer update. Here are the requires in the config:
"laravel/framework": "4.1.*",
"facebook/php-sdk": "dev-master",
"intervention/image": "1.*",
"ikimea/browser": "dev-master"
You could try renaming the Facade but I have never needed to. Also if you have just update everything today you may also want to have a look at the Laravel upgrade guide http://laravel.com/docs/upgrade
Other than that, I don't know. Can only suggest trying a fresh laravel install then require the lib and add my foo route. If that doesn't work then it could be something on the server maybe??
I got same error, this is my solve method:
Open your Laravel config file config/app.php and add the following lines.
In the $providers array add the service providers for this package.
'Intervention\Image\ImageServiceProvider'
Add the facade of this package to the $aliases array.
'Image' => 'Intervention\Image\Facades\Image'
Now the Image Class will be auto-loaded by Laravel.
Reference http://image.intervention.io/getting_started/laravel
@Luxurioust I have exactly what you have in my app.php file.
My image was just uploading just fine before I ran composer update. Ever since I ran it, it won't work... I'm getting the same error as the original poster.. and still can't fix it.
// Open image, resize, and save
$img = Image::make( $image );
$img->resize($this->largeThumbWith, $this->largeThumbHeight, true)->save($this->directory . $img->filename . '_thumb.' . $img->extension);
Where image is simply the path to the image (it exists as well.. already checked that).
I think it may have something to do with also have a model called 'Image'. I have a model called 'Image and I am getting this error. I changed the facade to:
'Img' => 'InterventionImageFacadesImage'
in the aliases array and it works fine. Is there a better way to handle this conflict?
I had this problem after a composer upgrade also.
had everything working before.
with @rodleviton suggestion it did work so I started wondering if it was because of the import on the top of the controller and in fact it was.
so back to 'Image' => 'InterventionImageFacadesImage'
and no use InterventionImageImage; on the top (import)
Broke for me as well, and I'm not integrating with laravel. I believe this change caused my problem: https://github.com/Intervention/image/commit/9bb6b213c26e3b61d3563c0974a44e2bef1b86dd#diff-f1c7a6ff10b1242aedacf53acceccdebL134
For now I'm jumping back to the prior commit until things are resolved.
Sorry for not responding earlier. The problem that I was having was do to not updating config/app.php in dev, staging and production. Just a user error.
I had the same problem, and the same solution...i just forgot to update the app.php file under the local enviroment
Still having the problem :/
Unfortunately changing the alias name to 'Img' (and any other like 'Imaadfadsfdasfaf' :P) doesn't work for me.
php composer.phar show -i
laravel/framework v4.2.6 The Laravel Framework.
intervention/image 2.0.5 Image handling and manipulation library with support for Laravel 4 integration
What's wrong?
I'm using also other libraries (ex: https://github.com/barryvdh/laravel-debugbar ), but just the Image alias doesnt work.
Hint for the library developers:
when I change a return format in InterventionImageFacadesImage.php from
return 'image'
to
return new \Intervention\Image\Image;
it start "working" - meaning that the exception ("call to undefined method....") isnt throwing. But next error appear
all to a member function executeCommand() on a non-object
in __call() function
The problem I had was I only many the changes to the production config and not the development config.
On Jul 8, 2014, at 22:35, Szymon Bluma [email protected] wrote:
Hint for the library developers:
when I change a return format in InterventionImageFacadesImage.php from
return 'image'
toreturn new InterventionImageImage;
it start "working" - meaning that the exception ("call to undefined method....") isnt throwing. But next error appearall to a member function executeCommand() on a non-object
in __call() function
—
Reply to this email directly or view it on GitHub.
Hmmmm... my issue - fixed.
I removed the vendor directory and install/update everything once again via composer. Now works :)
I'm still having same problem with Laravel
Call to undefined method Intervention\\Image\\Image::make()
I'm using version 2.*. Looking at the Image class in the vendor file. That method make() is not there. However, it's found in ImageManager. I compared this with previous version 1.5. I saw that the make() is actually a method in Image Class.
My question is that i'm referencing the wrong class?
@stanwarri
This has changed in version 2 as mentioned in the update notes
You have to call make from ImageManager or ImageManagerStatic. Laravel does this automatically via the Facade/ServiceProvider. If you're not using Laravel, check out this example.
I'm using Laravel latest version and have followed the install instructions several times.
Still receiving this error.
Is there a correlation with using GD library?
@mikeritter Have you tried to rename the facade. Maybe renaming it from Image to Img helps.
'Img' => 'Intervention\Image\Facades\Image'
Open composer.json and change this:
"intervention/image": "dev-master"
to this
"intervention/image": "1.*"
and then do
composer update
It works for me after doing this (after upgrading to L4.1)
If that's the case it looks like an edit was pulled in that should be rolled back.
Gonna have to try this and troubleshoot.
Thanks Glenn.
On Aug 8, 2014, at 4:51 PM, Glenn Plas [email protected] wrote:
Open composer.json and change this:
"intervention/image": "dev-master"
to this
"intervention/image": "1.*"
and then do
composer update
It works for me after doing this (after upgrading to L4.1)
—
Reply to this email directly or view it on GitHub.
You're welcome. If you want an easy way to reproduce, try this application https://github.com/msurguy/missingpetflyer , Then upgrade Laravel, make sure you follow the upgrade faq here to avoid wasting time in unrelated troubles. http://laravel.com/docs/upgrade#upgrade-4.1 . Then you're all set and will experience those issues trying to upload/download images. It just turns out 'image' library changed quite a bit over major versions and those older applications use functions that do not exists anymore in dev-master. So I personally think the composer.json should pin versions rather than just depend on the latest library. So I'm not convinced this is an issue with this library.
https://github.com/msurguy/missingpetflyer uses code from version 1.x of Intervention/Image, but installs dev-master (2.x). This can't work.
Yes, that is exactly what I think I was saying, thanks for rephrasing it.
Been thinking, perhaps my whole entry point to the problem I was having is wrong. I've had exact the same error messages as others here but they might have not been instigated by the same reasons. just thought I'd share this.
I use namespacing and I just added:
use Image
instead of the full path.
Worked fine.
Just spent the last hour wresting with this problem, in the chance it might help someone, my problem was simply that I'd forgotton to restart my XAMPP server after updating my php.ini file!!
See for yourself if you maybe have a model named Image. That would make a problem here.
Has this been fixed? I had to downgrade to "intervention/image": "1.*" to fix this issue.
Add
use Image;
on top of your controller without changing anything in app.php. It will work fine in laravel 5.*
@amjithps over 6 months since u commented but wanted you know it worked =) Thanks :+1:
It's still not working with:
even if I follow the installation.
I have problem implementing intervention, I fix this and some other problem, I run xampp in local and laravel framework 5.2, this is what you should do:
1- add these line in your composer.json
"laravelcollective/html": "5.2._",
"intervention/image": "dev-master",
"guzzlehttp/psr7":" ~1.1",
"Illuminate/Html": "~5.0",
"illuminate/support": "4._|5.*",
2- add provioder to your app.php in config folder
InterventionImageImageServiceProviderLaravel5::class,
add this line to alias
'Image' => InterventionImageFacadesImage::class,
3- open cmd.exe or windows powershel and write this command:
cd to your working folder of your project when you have your composer.json
composer update
4-i have these class included in my controller
use IlluminateDatabaseEloquentModel;
use IlluminateSupportFacadesDB;
use IlluminateSupportFacadesInput;
use IlluminateSupportFacadesView;
use IlluminateHttpRequest;
//use InterventionImageImage as Img;
//use InterventionImageImageManager;
use InterventionImageImageManagerStatic as Image;
//use SymfonyComponentHttpFoundationFileUploadedFile;
use AppHttpRequests;
I think use InterventionImageImageManagerStatic as Image; was the main class for intervention
5-this is my whole upload section
if (Input::hasFile('image'))
{
$file = Input::file('image');
$destinationPath = 'images/services';
$extension = $file->getClientOriginalExtension();
$filename = str_random(12).".{$extension}";
$upload_success = $file->move($destinationPath, $filename);
Input::merge(array('imageAddress' => $destinationPath.'/'.$filename));
//intervention image resize
$img= 'images/services'.'/'.$filename;
$img = Image::make(public_path($img))->resize(200, 200);
$img->save('images/services'.'/'.$filename);
}
you just need these three lines
//intervention image resize
$img= 'images/services'.'/'.$filename;
$img = Image::make(public_path($img))->resize(200, 200);
$img->save('images/services'.'/'.$filename);
Same problem for me. Changing alias to "Img" doesn't work, downgrading to 1.* also didn't worked :( Tried everything with fresh Laravel 5.3 to make it work :(
Laravel, Intervention and Amazon S3
use Intervention\Image\Facades\Image;
$file = $request->file('file'); // Get file input
$img = Image::make($file); // Create Intervention instance
$name = time() . '_' . $file->getClientOriginalName(); // Example file name
$payload = (string)$img->encode();
$upload = Storage::disk('s3')->put($name, $payload, 'public');
so folks, I don't know if it's resolved, but I ran that command "composer require intervention / image" and it worked again. I'm using version 7.29
Most helpful comment
I use namespacing and I just added:
use Image
instead of the full path.
Worked fine.