From 873a312ac04c0e0f3aa546c2e0fb51f872ccee55 Mon Sep 17 00:00:00 2001 From: cyc Date: Mon, 1 Apr 2019 13:48:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=B7=E8=AF=AD?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2amp=E9=A1=B5=E9=9D=A2=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../htmlcompressor/controllers/index_gm.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/application/third_party/htmlcompressor/controllers/index_gm.php b/application/third_party/htmlcompressor/controllers/index_gm.php index 0a987645..0ee105f1 100644 --- a/application/third_party/htmlcompressor/controllers/index_gm.php +++ b/application/third_party/htmlcompressor/controllers/index_gm.php @@ -279,16 +279,21 @@ class Index_gm extends CI_Controller //添加webp图片支持 $img_src_webp=''; if(substr($img_src, -4) == '.jpg'){ - $img_src_jpg=" width}\" height=\"{$img_size->height}\">"; + if($img_size->width < 400){ + $layout = 'fixed'; + }else{ + $layout = 'responsive'; + } + $img_src_jpg=" width}\" height=\"{$img_size->height}\">"; $img_src_webp=substr($img_src, 0, strlen($img_src) - 4).'.webp'; - $img_src_webp = " width}\" height=\"{$img_size->height}\">{$img_src_jpg}"; + $img_src_webp = " width}\" height=\"{$img_size->height}\">{$img_src_jpg}"; } if(!empty($img_src_webp)){ $image->outertext =$img_src_webp; }else{ - $image->outertext = " width}\" height=\"{$img_size->height}\">"; + $image->outertext = " width}\" height=\"{$img_size->height}\">"; } } } From b624a3f0bd7dd50a6d561f4999259ea108f657d1 Mon Sep 17 00:00:00 2001 From: cyc Date: Mon, 1 Apr 2019 14:00:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=B7=E8=AF=ADAMP?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/htmlcompressor/controllers/index_gm.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/third_party/htmlcompressor/controllers/index_gm.php b/application/third_party/htmlcompressor/controllers/index_gm.php index 0ee105f1..33c8e074 100644 --- a/application/third_party/htmlcompressor/controllers/index_gm.php +++ b/application/third_party/htmlcompressor/controllers/index_gm.php @@ -278,11 +278,10 @@ class Index_gm extends CI_Controller if (!empty($img_size)) { //添加webp图片支持 $img_src_webp=''; + $layout = 'responsive'; if(substr($img_src, -4) == '.jpg'){ if($img_size->width < 400){ $layout = 'fixed'; - }else{ - $layout = 'responsive'; } $img_src_jpg=" width}\" height=\"{$img_size->height}\">";