Skip to content

Commit

Permalink
Allow aliased thumbnails for image 'arrays'.
Browse files Browse the repository at this point in the history
Fixes #6015
  • Loading branch information
bobdenotter committed Nov 10, 2016
1 parent 9374e48 commit 0d8ec8f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Twig/Handler/ImageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private function getThumbnail($fileName = null, $width = null, $height = null, $
}

/**
* Get the thumbnail relative URI.
* Get the thumbnail relative URI, using width, height and action.
*
* @param Thumbnail $thumb
*
Expand All @@ -261,8 +261,21 @@ private function getThumbnailUri(Thumbnail $thumb)
);
}

/**
* Get the thumbnail relative URI, using an alias.
*
* @param mixed $filename
* @param string $alias
*
* @return mixed
*/
private function getAliasedUri($filename, $alias)
{
// If we're passing in an image as array, instead of a single filename.
if (is_array($filename) && isset($filename['file'])) {
$filename = $filename['file'];
}

if (!$this->isAlias($alias)) {
return false;
}
Expand Down

0 comments on commit 0d8ec8f

Please sign in to comment.