Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Neos.Media/Classes/Eel/ImageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ImageHelper implements ProtectedContextAwareInterface
* @throws ThumbnailServiceException
*/
public function createThumbnail(
AssetInterface $asset,
?AssetInterface $asset,
string $preset = null,
int $width = null,
int $maximumWidth = null,
Expand All @@ -53,6 +53,9 @@ public function createThumbnail(
int $quality = null,
string $format = null
): ?ImageInterface {
if (!$asset instanceof AssetInterface) {
return null;
}
if (!empty($preset)) {
$thumbnailConfiguration = $this->thumbnailService->getThumbnailConfigurationForPreset($preset);
} else {
Expand Down
4 changes: 2 additions & 2 deletions Neos.Neos/Resources/Private/Fusion/Prototypes/ImageTag.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ prototype(Neos.Neos:ImageTag) < prototype(Neos.Fusion:Tag) {
async = false
quality = NULL
preset = NULL
@context.thumbnail = ${Neos.Media.Image.createThumbnail(
@context.thumbnail = ${this.asset ? Neos.Media.Image.createThumbnail(
this.asset,
this.preset,
this.width,
Expand All @@ -22,7 +22,7 @@ prototype(Neos.Neos:ImageTag) < prototype(Neos.Fusion:Tag) {
this.async,
this.quality,
this.format
)}
) : null}

tagName = 'img'
attributes {
Expand Down