From 873a312ac04c0e0f3aa546c2e0fb51f872ccee55 Mon Sep 17 00:00:00 2001 From: cyc Date: Mon, 1 Apr 2019 13:48:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=B7=E8=AF=AD=E8=BD=AC?= =?UTF-8?q?=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}\">"; } } }