图片压缩

This commit is contained in:
2026-01-15 17:55:51 +08:00
parent 3d51a841cf
commit c77da51775
+3 -3
View File
@@ -157,7 +157,7 @@ class UploadController
->size(1024*1024*30)
->extYes(['image/jpeg','image/png'])
->extNo(['image/gif'])
->upload($file);
->upload($finalPath);
// 清理临时文件
@unlink($tmpPath);
@@ -199,8 +199,8 @@ class UploadController
$image->readImage($srcPath);
// 防止超大图
$maxWidth = 2000;
$maxHeight = 2000;
$maxWidth = 1280;
$maxHeight = 1280;
$image->thumbnailImage($maxWidth, $maxHeight, true);