I\'m using laravel 4 and I installed the Intervention Image package. When I\'m using it in my code whith method -
this in solution
$filename = str_slug($products->name)."-0.jpg";
$filename_fb = 'fb-'.$filename;
$filename_tw = 'tw-'.$filename;
$img = Image::make($_FILES['photo']['tmp_name']);
// resize image
$img->resize(800, 400);
// save image
$img->save($path.'/'.$filename);
if you use a sub-folder in your public path, use chmod to change the permission on that folder
e.g
cd public;
chmod -Rv 755 public/{your_path_name};
Run
man chmod;
for more details
Change this:
$file = Image::make('url_Avatar');
To this:
$file = Input::file('url_Avatar');
// ...
$filename = '...';
Image::make($file->getRealPath())->resize('200','200')->save($filename);
Read more about file on Laravel documentation.
I have the same problem. When I change image driver everything works fine.
Try to change image driver from app/config/packages/intervention/image/config.php from GD to Imagick
If you cant find config file try to run commands below:
Publish configuration in Laravel 5
$ php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"
Publish configuration in Laravel 4
$ php artisan config:publish intervention/image
Example content from config file:
return array(
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
|
| Intervention Image supports "GD Library" and "Imagick" to process images
| internally. You may choose one of them according to your PHP
| configuration. By default PHP's "GD Library" implementation is used.
|
| Supported: "gd", "imagick"
|
*/
'driver' => 'imagick'
);