From 1995880094b51118645cd04c2ae345dc8e07f96e Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 13 Mar 2019 14:06:29 +0100 Subject: [PATCH] resize the main logo This avoids downloading an oversized image --- Template.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Template.php b/Template.php index 85163ac..544a7d8 100644 --- a/Template.php +++ b/Template.php @@ -189,9 +189,10 @@ class Template { * @param array $attributes * @param int $w * @param int $h + * @param bool $crop * @return string */ - public static function getResizedImgTag($tag, $attributes, $w, $h) { + public static function getResizedImgTag($tag, $attributes, $w, $h, $crop = true) { $attr = ''; $medias = array(); @@ -214,7 +215,7 @@ class Template { if($media === '') return ''; // replace the array - $media = ml($media, array('w' => $w, 'h' => $h, 'crop' => 1), true, '&'); + $media = ml($media, array('w' => $w, 'h' => $h, 'crop' => (int) $crop), true, '&'); $attributes[$attr] = $media; // return the full tag @@ -244,7 +245,7 @@ class Template { 'src' => array('wiki:logo-wide.png', 'wiki:logo.png'), 'alt' => $title, ), - 0, 0 + 0, 50, false ); $mobile = self::getResizedImgTag( 'img',