1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 19:44:09 +02:00

Include width/height attributes in img tags with cropped thumbnails.

This commit is contained in:
Cameron
2016-02-07 13:28:55 -08:00
parent 3074814d42
commit 8660d2d890
2 changed files with 19 additions and 4 deletions

View File

@@ -2177,7 +2177,19 @@ class e_parse extends e_parser
}
/**
* Retrieve img tag width and height attributes for current thumbnail.
* @return string
*/
public function thumbDimensions($type = 'single')
{
if(!empty($this->thumbCrop) && !empty($this->thumbWidth) && !empty($this->thumbHeight)) // dimensions are known.
{
return ($type == 'double') ? 'width="'.$this->thumbWidth.'" height="'.$this->thumbHeight.'"' : "width='".$this->thumbWidth."' height='".$this->thumbHeight."'";
}
return null;
}
/**