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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user