Quellcode durchsuchen

thumbnail image

zhangdehua vor 7 Monaten
Ursprung
Commit
9d2465f2a8
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      app/common.php
  2. 1 1
      app/store/controller/Upload.php

+ 1 - 1
app/common.php

@@ -496,7 +496,7 @@ function curl_get($url)
     return $result;
 }
 
-function createThumbnail($sourceFile, $thumbnailFile, $thumbnailWidth = 400, $quality = 80) {
+function createThumbnail($sourceFile, $thumbnailFile, $thumbnailWidth = 100, $quality = 80) {
     // 获取原图像信息
     list($sourceWidth, $sourceHeight, $sourceType) = getimagesize($sourceFile);
     $sourceMime = image_type_to_mime_type($sourceType);

+ 1 - 1
app/store/controller/Upload.php

@@ -82,7 +82,7 @@ class Upload extends Controller
         $thumbnailFile = public_path() . 'uploads/' . $storeId . '/' . $date . '/TH' . $fileName;// 缩略图保存路径
         // 使用示例
         try {
-            createThumbnail($filePathAbsolute, $thumbnailFile, 100, 80); // 创建缩略图
+            createThumbnail($filePathAbsolute, $thumbnailFile, 400, 80); // 创建缩略图
         } catch (Exception $e) {
             Log::error($e->getMessage());
             return $this->renderError($e->getMessage());