File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ function echoAsPng(string $svg): void
317317{
318318 // trim off all whitespaces to make it a valid SVG string
319319 $ svg = trim ($ svg );
320-
320+
321321 // remove style and animations
322322 $ svg = preg_replace ('/(<style>\X*<\/style>)/m ' , '' , $ svg );
323323 $ svg = preg_replace ('/(opacity: 0;)/m ' , 'opacity: 1; ' , $ svg );
@@ -329,8 +329,9 @@ function echoAsPng(string $svg): void
329329 $ imagick ->setBackgroundColor (new ImagickPixel ('transparent ' ));
330330
331331 // add svg image
332+ $ imagick ->setFormat ('svg ' );
332333 $ imagick ->readImageBlob ('<?xml version="1.0" encoding="UTF-8" standalone="no"?> ' . $ svg );
333- $ imagick ->setImageFormat ('png ' );
334+ $ imagick ->setFormat ('png ' );
334335
335336 // echo PNG data
336337 header ('Content-Type: image/png ' );
You can’t perform that action at this time.
0 commit comments