diff --git a/Classes/Domain/AssetImageSource.php b/Classes/Domain/AssetImageSource.php index b6f2e4a..e37ab75 100644 --- a/Classes/Domain/AssetImageSource.php +++ b/Classes/Domain/AssetImageSource.php @@ -7,8 +7,8 @@ use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\ActionRequest; use Neos\Media\Domain\Model\AssetInterface; +use Neos\Media\Domain\Model\AssetVariantInterface; use Neos\Media\Domain\Model\ImageInterface; -use Neos\Media\Domain\Model\ImageVariant; use Neos\Media\Domain\Model\ThumbnailConfiguration; use Neos\Media\Domain\Model\VariantSupportInterface; use Neos\Media\Domain\Service\AssetService; @@ -78,13 +78,13 @@ public function withVariantPreset(string $presetIdentifier, string $presetVarian $newSource = parent::withVariantPreset($presetIdentifier, $presetVariantName); if ($newSource->targetImageVariant !== []) { - $asset = ($newSource->asset instanceof ImageVariant) ? $newSource->asset->getOriginalAsset() : $newSource->asset; + $asset = ($newSource->asset instanceof AssetVariantInterface && $newSource->asset instanceof ImageInterface) ? $newSource->asset->getOriginalAsset() : $newSource->asset; if ($asset instanceof VariantSupportInterface) { $assetVariant = $asset->getVariant($newSource->targetImageVariant['presetIdentifier'], $newSource->targetImageVariant['presetVariantName']); } else { $assetVariant = null; } - if ($assetVariant instanceof ImageVariant) { + if ($assetVariant instanceof AssetVariantInterface && $assetVariant instanceof ImageInterface) { $newSource->asset = $assetVariant; $newSource->baseWidth = $assetVariant->getWidth(); $newSource->baseHeight = $assetVariant->getHeight();