/**
* Renders the path to a thumbnail image, created from a given asset.
*
* @param AssetInterface $asset
* @param integer $width Desired width of the thumbnail
* @param integer $maximumWidth Desired maximum width of the thumbnail
* @param integer $height Desired height of the thumbnail
* @param integer $maximumHeight Desired maximum height of the thumbnail
* @param boolean $allowCropping Whether the thumbnail should be cropped if the given sizes would hurt the aspect ratio
* @param boolean $allowUpScaling Whether the resulting thumbnail size might exceed the size of the original asset
* @param boolean $async Return asynchronous image URI in case the requested image does not exist already
* @param string $preset Preset used to determine image configuration
* @return string the relative thumbnail path, to be used as src attribute for <img /> tags
*/
public function render(AssetInterface $asset = null, $width = null, $maximumWidth = null, $height = null, $maximumHeight = null, $allowCropping = false, $allowUpScaling = false, $async = false, $preset = null)
{
if ($preset) {
$thumbnailConfiguration = $this->thumbnailService->getThumbnailConfigurationForPreset($preset, $async);
} else {
$thumbnailConfiguration = new ThumbnailConfiguration($width, $maximumWidth, $height, $maximumHeight, $allowCropping, $allowUpScaling, $async);
}
return $this->assetService->getThumbnailUriAndSizeForAsset($asset, $thumbnailConfiguration, $this->controllerContext->getRequest())['src'];
}