--- /tmp/MediaViewHelper.php 2021-10-07 12:05:47.908955924 +0200 +++ source/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php 2021-10-07 12:32:37.407039761 +0200 @@ -156,8 +156,16 @@ } } $this->tag->addAttribute('src', $imageUri); - $this->tag->addAttribute('width', $processedImage->getProperty('width')); - $this->tag->addAttribute('height', $processedImage->getProperty('height')); + if('svg' == $image->getProperty('extension')) + { + if(0 < $width) $this->tag->addAttribute('width', $width); + if(0 < $height) $this->tag->addAttribute('height', $height); + } + else + { + $this->tag->addAttribute('width', $processedImage->getProperty('width')); + $this->tag->addAttribute('height', $processedImage->getProperty('height')); + } if (in_array($this->arguments['loading'] ?? '', ['lazy', 'eager', 'auto'], true)) { $this->tag->addAttribute('loading', $this->arguments['loading']); }