Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel为存储器中的图片添加模糊_Php_Laravel_Laravel 7_Imagick - Fatal编程技术网

Php Laravel为存储器中的图片添加模糊

Php Laravel为存储器中的图片添加模糊,php,laravel,laravel-7,imagick,Php,Laravel,Laravel 7,Imagick,我正在商店里保存图像。这里我需要制作一个模糊的图像 $path = $request->file('file-upload-photo-profile')->store('public/profile'); $user->photo_profile_url = 'storage/app/'.$path; $user->photo_profile = $path; /* * теперь блур

我正在商店里保存图像。这里我需要制作一个模糊的图像

$path = $request->file('file-upload-photo-profile')->store('public/profile');
        $user->photo_profile_url = 'storage/app/'.$path;
        $user->photo_profile = $path;
        /*
         * теперь блур
         * */
        $url=url('/').'/'.$user->photo_profile_url;
        $image=imagecreatefromjpeg($url);
        $imagick = new Imagick($image);
        $imagick->blurImage(5, 5);
         $imagick->getImageBlob();

        Storage::put('dssds.jpg',$imagick);

但无法打开生成的文件。这不是一张图片。

我认为您正在从404页面读取图像的这个url(photo\u profile\u url)会导致您在存储的内部路径中使用laravel的url()函数。如果要从url加载图像,请将图像的公共url传递给Imagick。

路径是真实的。如果您更改它,则会出现另一个错误。