Skip to content
Merged
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
10 changes: 2 additions & 8 deletions Classes/Factory/ImageSourceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Neos\Flow\ResourceManagement\ResourceManager;
use Sitegeist\Kaleidoscope\Domain\AssetImageSource;
use Sitegeist\Kaleidoscope\Domain\ImageSourceInterface;
use Sitegeist\Kaleidoscope\Domain\SvgAssetImageSource;
use Sitegeist\Kaleidoscope\Domain\UriImageSource;
use Sitegeist\Kaleidoscope\ValueObjects\ImageSourceProxy;
use Sitegeist\Kaleidoscope\ValueObjects\ImageSourceProxyCollection;
Expand All @@ -20,13 +21,6 @@ class ImageSourceFactory
#[Flow\Inject]
protected ResourceManager $resourceManager;

/**
* @var string[]
*/
protected array $nonScalableMediaTypes = [
'image/svg+xml',
];

public function tryCreateFromProxy(ImageSourceProxy $imageSourceProxy): ?ImageSourceInterface
{
$image = $this->imageFactory->tryCreateFromProxy($imageSourceProxy->asset);
Expand All @@ -35,7 +29,7 @@ public function tryCreateFromProxy(ImageSourceProxy $imageSourceProxy): ?ImageSo
return null;
}

if (in_array($image->getResource()->getMediaType(), $this->nonScalableMediaTypes, true)) {
if (!$image->getWidth() || !$image->getHeight()) {
$uri = $this->resourceManager->getPublicPersistentResourceUri($image->getResource());
if (is_string($uri)) {
return new UriImageSource(
Expand Down