拉拉维尔文件管理器:裁剪和调整大小时出现 500 内部服务器错误



我在Laravel 5.4中使用unisharp filemanager - laravel-filemanager

我根据文档和集成配置了所有内容。我现在可以上传文件,但无法裁剪和调整相同的上传图像的大小。
我在控制台

中收到以下错误

Failed to load resource: the server responded with a status of 500 (Internal Server Error) - http://127.0.0.1:8000/laravel-filemanager/doresize?img=http%3A%2F%2F127.0.0.1%3A8000%2Fphotos%2F1%2F835e871b8f5105255b1ead21947b6799.jpeg&working_dir=%2F1&dataHeight=&dataWidth=&=1490245875358如果我转到上面的链接,它会抛出错误

NotReadableException in AbstractDecoder.php line 335: Image source not readable

文件管理器中crop.blade.php中的代码如下所示

 <button class="btn btn-primary" onclick="performCrop()">
  {{ trans('laravel-    filemanager::lfm.btn-crop') }}
 </button>
 <button class="btn btn-info" onclick="loadItems()">
  {{ trans('laravel-    filemanager::lfm.btn-cancel') }}
 </button>
  <form action="{{ route('unisharp.lfm.getCrop') }}" role='form' name='cropForm' id='cropForm' mathod='post'>
    <input type="hidden" id="img" name="img" value="{{ $img }}">
    <input type="hidden" id="working_dir" name="working_dir" value="{{ $working_dir }}">
    <input type="hidden" id="dataX" name="dataX">
    <input type="hidden" id="dataY" name="dataY">
    <input type="hidden" id="dataWidth" name="dataWidth">
    <input type="hidden" id="dataHeight" name="dataHeight">
    <input type='hidden' name='_token' value='{{csrf_token()}}'>
  </form>`

如何解决此500内部服务器错误错误?

在要上传文件的目录中尝试 chown 和 chmod。这是一个教程 chmod, chown

进入你的项目名称/unisharp/laravel-filemanager/views/crop.blade.php 并在此方法上: 函数

performCrop(){..
data:{
  img: '{{ $img }}', -> change this with 
  img: '{{ parse_url($img, PHP_URL_PATH) }}',
  ...
}

对 resize.balde 执行相同的操作.php

参考链接: https://github.com/UniSharp/laravel-filemanager/issues/213

相关内容

最新更新