From 3c43d07d83cb7ca0ee113e80cc7c5cfc9b75d999 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 7 Feb 2016 13:37:45 -0800 Subject: [PATCH] Include width/height attributes in img tags with cropped thumbnails. toImage() and toIcon() methods. --- e107_handlers/e_parse_class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index e33e54686..ea0ae17f5 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -3309,6 +3309,7 @@ class e_parser } $ext = pathinfo($icon, PATHINFO_EXTENSION); + $dimensions = null; if(!$ext || $ext == 'glyph') // Bootstrap or Font-Awesome. { @@ -3318,6 +3319,7 @@ class e_parser if(strpos($icon,'e_MEDIA')!==FALSE) { $path = $this->thumbUrl($icon); + $dimensions = $this->thumbDimensions(); } elseif($icon[0] == '{') { @@ -3344,10 +3346,11 @@ class e_parser { $path = $icon; } - + + + - - return "".basename($path).""; + return "".basename($path).""; } @@ -3386,10 +3389,12 @@ class e_parser $tp->setThumbSize(null, $parm['h']); } + $dimensions = null; if(strpos($file,'e_MEDIA')!==false || strpos($file,'e_THEME')!==false) //v2.x path. { $path = $tp->thumbUrl($file,null,null,true); + $dimensions = $this->thumbDimensions(); } elseif($file[0] == '{') // Legacy v1.x path. Example: {e_WHEREEVER} { @@ -3431,7 +3436,7 @@ class e_parser $alt = (!empty($parm['alt'])) ? $tp->toAttribute($parm['alt']) : basename($path); - return "\"".$alt."\""; + return "\"".$alt."\""; }