Răsfoiți Sursa

图片处理

shish 6 ani în urmă
părinte
comite
c3262ce381
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      common/components/business.php

+ 2 - 1
common/components/business.php

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