From d3eb0fcc5360b55a3c5c41c493764efaa37fe381 Mon Sep 17 00:00:00 2001 From: Lorenz Ulrich Date: Wed, 4 May 2022 15:37:28 +0200 Subject: [PATCH] TASK: Don't try replacing asset resources of ImageVariants It is not allowed replacing asset resources of ImageVariants because an ImageVariant is always based on an Image. --- Classes/ImageResizerUtility.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Classes/ImageResizerUtility.php b/Classes/ImageResizerUtility.php index 1b70d53..09f24f6 100644 --- a/Classes/ImageResizerUtility.php +++ b/Classes/ImageResizerUtility.php @@ -4,6 +4,7 @@ use Neos\Flow\Annotations as Flow; use Neos\Media\Domain\Model\AssetInterface; +use Neos\Media\Domain\Model\ImageVariant; use Neos\Media\Domain\Model\ThumbnailConfiguration; use Neos\Media\Domain\Service\AssetService; use Neos\Media\Domain\Service\ThumbnailService; @@ -35,6 +36,10 @@ class ImageResizerUtility public function resize(AssetInterface $asset) { + if ($asset instanceof ImageVariant) { + return; + } + $configuration = $this->configuration; $sourceMediaType = MediaTypes::parseMediaType($asset->getMediaType());