Skip to content

Commit

Permalink
BUGFIX: Check if image is possible to refit on replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubitz committed Nov 15, 2023
1 parent 9e0b9ba commit 6011f88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Neos.Media/Classes/Domain/Service/AssetService.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ public function replaceAssetResource(AssetInterface $asset, PersistentResource $
$variant->refresh();
foreach ($variant->getAdjustments() as $adjustment) {
if (method_exists($adjustment, 'refit') && $this->imageService->getImageSize($originalAssetResource) !== $this->imageService->getImageSize($resource)) {
$adjustment->refit($asset);
if ($asset instanceof ImageInterface && $asset->getWidth() !== null && $asset->getHeight() !== null) {
$adjustment->refit($asset);
}
}
}
$this->getRepository($variant)->update($variant);
Expand Down

0 comments on commit 6011f88

Please sign in to comment.