moonsflyer 4 mesi fa
parent
commit
3a3c85b5af
1 ha cambiato i file con 9 aggiunte e 2 eliminazioni
  1. 9 2
      app/common/service/storage/engine/Server.php

+ 9 - 2
app/common/service/storage/engine/Server.php

@@ -73,13 +73,20 @@ abstract class Server
         $quality = ConfigService::get('upload', 'image_quality', 80);
         $maxWidth = ConfigService::get('upload', 'max_width', 1920);
         $maxHeight = ConfigService::get('upload', 'max_height', 1080);
-        
-        return ImageCompressService::compress(
+        // 添加调试信息
+        error_log('开始压缩图片: ' . $this->fileInfo['realPath']);
+        $result = ImageCompressService::compress(
             $this->fileInfo['realPath'],
             $quality,
             $maxWidth,
             $maxHeight
         );
+        if ($result === false) {
+            error_log('图片压缩失败: ' . $this->fileInfo['realPath']);
+        } else {
+            error_log('图片压缩成功: ' . $result);
+        }
+        return $result;
     }
 
     /**