|
|
@@ -17,6 +17,7 @@ class ImageCompressService
|
|
|
public static function compress($sourcePath, $quality = 80, $maxWidth = 1920, $maxHeight = 1080)
|
|
|
{
|
|
|
try {
|
|
|
+ outFileLog($sourcePath,'upload_img','$sourcePath1');
|
|
|
// 获取图片信息
|
|
|
$imageInfo = getimagesize($sourcePath);
|
|
|
outFileLog($imageInfo,'upload_img','imgInfo');
|
|
|
@@ -33,7 +34,7 @@ class ImageCompressService
|
|
|
if ($width <= $maxWidth && $height <= $maxHeight && $quality >= 90) {
|
|
|
return $sourcePath;
|
|
|
}
|
|
|
- outFileLog($sourcePath,'upload_img','$sourcePath');
|
|
|
+ outFileLog($sourcePath,'upload_img','$sourcePath2');
|
|
|
// 计算新尺寸
|
|
|
$newSize = self::calculateNewSize($width, $height, $maxWidth, $maxHeight);
|
|
|
$newWidth = $newSize['width'];
|