我想用干预图像包调整我的图像大小,但是当我尝试时,它会给我这个错误。
干预 image exception notredableException
图像源不可读
我的代码;
if ($request->hasFile('featured_image')) {
$realname = pathinfo($request->file('featured_image')->getClientOriginalName(), PATHINFO_FILENAME);
$extension = $request->file('featured_image')->getClientOriginalExtension();
$new_name = $realname."-".time().".".$extension;
$request->file('featured_image')->storeAs('public/uploads',$new_name);
$path = Storage::url('uploads/'.$new_name);
$post->featured_image = $path;
Image::make($path)->resize(320, 240)->insert($path);
}
我该如何修复?
使用图像而不是URL的完整路径,例如:
Image::make(storage_path('uploads/'. $new_name'))