【问题标题】:Command (insert) is not available for driver (Gd)命令(插入)不适用于驱动程序(Gd)
【发布时间】:2017-02-22 22:24:29
【问题描述】:

您好,我正在使用图像干预。项目在本地服务器上运行良好。 我的远程服务器 Digitalocean droplet 和 Lamp Ubuntu 14.04 已安装。我确定所有必要的模块都已安装并处于活动状态。

  • GD 版本 => 2.1.1-dev
  • imagick 模块版本 => 3.1.2
  • PHP 版本 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);

如果 ->insert 函数绕过我在 droplet 上工作的代码。但是当添加到 ->insert 到代码抛出错误消息时。

Laravel 5.2 抛出此错误消息:Command (insert) 不适用于驱动程序 (Gd) 我正在努力。如何解决这个问题。我输了一天:(

【问题讨论】:

    标签: laravel-5.2 ubuntu-14.04 gd imagick intervention


    【解决方案1】:
    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');
    

    【讨论】:

      【解决方案2】:

      我解决了我的问题。

      我之前在服务器上使用土耳其语区域设置。当我在任何 Ubuntu 版本上设置为土耳其语区域设置时。所有小“i”字符都更改为大“İ”字符。你知道 Laravel 框架上的正确类名。每个班级的名字都以大字开头。我们不需要“İ”字符来处理开发代码。 这个问题从我的生活中偷走了 3 天。我正在重建服务器 12 次。我现在很开心!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-02-13
        • 2011-05-11
        • 2018-04-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多