当我上传大图像 (4.2 MB) 干预图像抛出 500 错误...
private function resizeImage($path, $imgName){
$sizes = getimagesize($path.$imgName);
if($sizes[0] > $sizes[1]){
ImageManagerStatic::make($path.$imgName)->fit(920,474)->insert(public_path() . "/uploads/applications/watermark.png",'bottom-right', 30, 30)->save($path."1_".$imgName);
}else{
ImageManagerStatic::make($path.$imgName)->heighten(474)->insert(public_path() . "/uploads/applications/watermark.png",'bottom-right', 30, 30)->save($path."1_".$imgName);
}
ImageManagerStatic::make($path.$imgName)->fit(440,226)->save($path."2_".$imgName);
File::delete($path.$imgName);
}
它适用于较小的文件。upload_max_filesize=10M
. 当我评论此功能时,它可以工作:/