binbinyouli 6 лет назад
Родитель
Сommit
88bb8e1b65

+ 3 - 3
app/admin/controller/ImgController.php

@@ -44,7 +44,7 @@ class ImgController {
                     $image = imagecreatefromgif($imgsrc);
                     imagecopyresampled($image_wp, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
                     //90代表的是质量、压缩图片容量大小
-                    imagejpeg($image_wp, $imgdst, 90);
+                    imagejpeg($image_wp, $imgdst, 100);
                     imagedestroy($image_wp);
                     imagedestroy($image);
                 }
@@ -55,7 +55,7 @@ class ImgController {
                 $image = imagecreatefromjpeg($imgsrc);
                 imagecopyresampled($image_wp, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
                 //90代表的是质量、压缩图片容量大小
-                imagejpeg($image_wp, $imgdst, 90);
+                imagejpeg($image_wp, $imgdst, 100);
                 imagedestroy($image_wp);
                 imagedestroy($image);
                 break;
@@ -65,7 +65,7 @@ class ImgController {
                 $image = imagecreatefrompng($imgsrc);
                 imagecopyresampled($image_wp, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
                 //90代表的是质量、压缩图片容量大小
-                imagejpeg($image_wp, $imgdst, 90);
+                imagejpeg($image_wp, $imgdst, 100);
                 imagedestroy($image_wp);
                 imagedestroy($image);
                 break;

+ 9 - 5
app/admin/controller/JiamengController.php

@@ -140,13 +140,17 @@ class JiamengController extends AdminBaseController{
 
     public function addPost(){
         // $onepic='.\upload\admin\20191224\d0462810bfc159fd8b16998571c2023.png';
-        // $img=new ImgController(); 
-        // $two='.\upload\admin\20191224\2.png';
+        ////$img=new ImgController(); 
+        // $two='.\upload\admin\20191224\d0462810bfc159fd8b16998571c2023.png';
         // $img->compressedImage($onepic,$two);
         // die();
-        
-        //echo file_exists('.\upload\admin\20191224\14e627ad5ba5036ee447cfd571d2bed7.png').'sdfsf';die;
-        $param = $this->request->param();var_dump($param);die();
+       
+         // echo file_exists('./upload/admin/20191224/d0462810bfc159fd8b16998571c2023.png').'sdfsf';die;
+         //// $param = $this->request->param();
+         //// $imgsrc="./upload/".$param['thumb'];
+         //// $img->compressedImage($imgsrc,$imgsrc);
+         //echo file_exists($img);echo $img;
+        //var_dump($param);die();
         isset($param['thumb'])&&$param['thumb']!='' or $this->error('请上传标题图片');
         isset($param['logo'])&&$param['logo']!='' or $this->error('请上传logo图片');
         isset($param['title'])&&$param['title']!='' or $this->error('请填写品牌名称');