public thumbnail ( string $fileName = null, string | integer $width = null, string | integer $height = null, string $crop = null ) : string | ||
$fileName | string | Target filename |
$width | string | integer | Target width |
$height | string | integer | Target height |
$crop | string | Zooming and cropping: Set to 'f(it)', 'b(orders)', 'r(esize)' or 'c(rop)' Set width or height parameter to '0' for proportional scaling Setting them to '' uses default values. |
return | string | Relative URL of the thumbnail |
public function thumbnail($fileName = null, $width = null, $height = null, $crop = null)
{
//Check if it's an alias as the only parameter after $filename
if ($width && !$height && !$crop && $this->isAlias($width)) {
return $this->getAliasedUri($fileName, $width);
}
$thumb = $this->getThumbnail($fileName, $width, $height, $crop);
return $this->getThumbnailUri($thumb);
}