public function rendition(Rendition $rendition, $width, $height, ArticleRendition $articleRendition = null)
{
if ($articleRendition !== null) {
$preview = $articleRendition->getRendition()->getPreview($width, $height);
$preview->setCoords($articleRendition->getImageSpecs());
$thumbnail = $rendition->fits($articleRendition->getImage()) ? $this->imageService->getThumbnail($preview, $articleRendition->getImage()) : null;
} else {
$preview = $rendition->getPreview($width, $height);
$thumbnail = null;
}
$this->view->isDefault = $thumbnail === null || $articleRendition->isDefault();
$this->view->preview = $preview;
$this->view->rendition = $rendition;
$this->view->thumbnail = $thumbnail;
return $this->view->render('image/rendition.phtml');
}