Skip to content

Commit

Permalink
Merge pull request #4753 from neos/bugfix/image-replace-with-svg
Browse files Browse the repository at this point in the history
BUGFIX: Check if image is possible to refit on replacement
  • Loading branch information
dlubitz authored Nov 15, 2023
2 parents 9e0b9ba + 6011f88 commit 89d793c
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 89d793c

Please sign in to comment.