Search code examples
laravel-5ubuntu-14.04gdimagickintervention

Command (insert) is not available for driver (Gd)


Hello Im working with Image Intervention. Project working very well from local server. My remote server Digitalocean droplet and Lamp Ubuntu 14.04 installed. Im sure all necessary modules installed and active.

  • GD Version => 2.1.1-dev
  • imagick module version => 3.1.2
  • PHP Version 5.5.9-1ubuntu4.21

Image::make('uploads/products/'.$filename)->fit(440, 585)->insert('uploads/watermark.png','center',0,0)->save('uploads/products/'.$filename, 100);

if ->insert function bypass my codes working on droplet. but when add to ->insert to code throwing error message.

Laravel 5.2 throw this error message: Command (insert) is not available for driver (Gd) Im trying all of my mind. how to fix this problem. I lost a one day :(


Solution

  • setlocale(LC_ALL, 'en_GB.UTF-8');
    $file = $request->file('file');
    list($filename, $extension) = explode(".", $file->getClientOriginalName());
    $filename = strtolower(str_slug(uniqid().'-'.$filename).'.'.$extension);
    $fileSave = $file->move('uploads/post',$filename);
    Image::make('uploads/post/'.$filename)->fit(440, 585)->insert('uploads/watermark.png','center',0,0)->save('uploads/post/'.$filename, 60);
    setlocale(LC_ALL, 'tr_TR.UTF-8');