3

I tried to use image intevention with laravel 5 to upload images and resize.. but i have this error message:

NotSupportedException in Driver.php line 18: ImageMagick module not available with this PHP installation.

installation: require intervention/image

config/app.php

'providers' =>[
'Intervention\Image\ImageServiceProvider']

'aliases' => [
'Image' => 'Intervention\Image\Facades\Image'
]

then my controller:

    public function postUpload(){

        //$imagen = Input::file('image');
        $imagen = Request::input('imagen1');
        // create an image manager instance with favored driver
        $manager = new ImageManager(array('driver' => 'imagick'));

        // to finally create image instances
        $image = $manager->make('public/'.$imagen)->resize(300, 200);
    }

then my view:

     {!! Form::label('imagen1', 'Imagen principal' , ['class' => "col-md-4 control-label"]) !!}
                        <div class="col-md-4">
                            <input type="file" id="exampleInputFile" name="imagen1">
                        </div>

then..Publish configuration in Laravel 5:

php artisan vendor:publish --  provider="Intervention\Image\ImageServiceProviderLaravel5"

I dont know if i have to install ImageMagick, because i have the same problem to upload with GD driver.

Leoh
  • 642
  • 2
  • 17
  • 41
  • You will need to check 2 things. one is imagemagik installed. you can see by checking on commandline "which convert" and if you don't know, just install it, with with yum or apt-get, which ever OS you are using. also you will need to have installed php-imagick - if you have say php56 installed you would need to install php56-imagick. – rbz Aug 25 '15 at 22:50

0 Answers0