Kaynağa Gözat

生成小图

shish 6 yıl önce
ebeveyn
işleme
0260a2ca0e
1 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 5 5
      common/components/business.php

+ 5 - 5
common/components/business.php

@@ -62,7 +62,7 @@ class business
 			$smallImg = self::getSmallImg($imgUrl);
 			$small = $prefixImgUrl . $smallImg;
 			$normal = $prefixImgUrl . $imgUrl;
-			/*
+			
 						$preImg = $imageRoot . str_replace('/uploads', '', $imgUrl);
 						if (file_exists($preImg)) {
 							//没有小图则生成小图,兼容旧系统
@@ -70,14 +70,14 @@ class business
 								$imgInfo = getimagesize($preImg);
 								$width = $imgInfo[0];
 								$height = $imgInfo[1];
-								//生成小图 200px
-								$smallWidth = 200;
-								$smallHeight = ceil((200 * $height) / $width);
+								//生成小图 300px
+								$smallWidth = 300;
+								$smallHeight = ceil((300 * $height) / $width);
 								$smallFullPathFile = $imageRoot . str_replace('/uploads', '', $smallImg);
 								Image::thumbnail($preImg, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
 							}
 						}
-			*/
+			
 			$imgList[] = $normal;
 			$smallImgList[] = $small;
 		}