From: Vincent Vanwaelscappel Date: Mon, 12 Sep 2022 17:48:51 +0000 (+0200) Subject: wait #5448 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=91fea07d6b51b4d62cf59770097c2f3d390ad058;p=fluidbook_tools.git wait #5448 @0:20 --- diff --git a/src/SVG/SVGTools.php b/src/SVG/SVGTools.php index 4c08a17..c7c5b5f 100644 --- a/src/SVG/SVGTools.php +++ b/src/SVG/SVGTools.php @@ -25,6 +25,18 @@ class SVGTools return self::_optimizeSVG($in, $out); } + public static function optimizeSVGStr($in) + { + $infile = Files::tempnam() . '.svg'; + file_put_contents($infile, $in); + $outfile = Files::tempnam() . '.svg'; + self::optimizeSVG($infile, $outfile); + $res = file_get_contents($outfile); + unlink($infile); + unlink($outfile); + return $res; + } + public static function _optimizeSVG($in, $out) {