diff --git a/src/image/Svg.php b/src/image/Svg.php index 4d52b49bb8f..bf8a9fe63e2 100644 --- a/src/image/Svg.php +++ b/src/image/Svg.php @@ -89,6 +89,8 @@ public function loadImage(string $path): self // If the size is defined by viewbox only, add in width and height attributes if (!preg_match(self::SVG_WIDTH_RE, $svg) && !preg_match(self::SVG_HEIGHT_RE, $svg)) { + $svg = preg_replace(self::SVG_CLEANUP_WIDTH_RE, '${1}', $svg); + $svg = preg_replace(self::SVG_CLEANUP_HEIGHT_RE, '${1}', $svg); $svg = preg_replace(self::SVG_TAG_RE, "