ref.inc.php を編集する
loading="lazy" を追加する- $params['_body'] = "<img src=\"$url\" alt=\"$title\" title=\"$title\" $info/>"; + $params['_body'] = "<img src=\"$url\" alt=\"$title\" title=\"$title\" loading=\"lazy\" $info/>";
これは不要かも?
## Webp Image AddType image/webp .webp
define('PLUGIN_REF_IMAGE', '/\.(gif|png|jpe?g|swf)$/i');
$got = @getimagesize($ref);
if (! isset($got[2])) $got[2] = FALSE;
switch ($got[2]) {
case 1: $type = 'image/gif' ; break;
case 2: $type = 'image/jpeg'; break;
case 3: $type = 'image/png' ; break;
case 4: $type = 'application/x-shockwave-flash'; break;
default:
return array('msg'=>'Seems not an image', 'body'=>$usage);
}
define('PLUGIN_REF_IMAGE', '/\.(gif|png|jpe?g|webp)$/i');
$got = @getimagesize($ref);
if (!isset($got[2])) $got[2] = FALSE;
$type = mime_content_type($ref); // MIMEタイプの確認
switch ($type) {
case 'image/gif' : $type = 'image/gif' ; break;
case 'image/jpeg': $type = 'image/jpeg'; break;
case 'image/png' : $type = 'image/png' ; break;
case 'image/webp': $type = 'image/webp'; break;
default:
return array('msg'=>'Seems not an image', 'body'=>$usage);
}
参考になるかも? WEBP画像のフォールバック - レ点腫瘍学ノート