From: Vincent Vanwaelscappel Date: Fri, 23 Feb 2024 16:33:42 +0000 (+0100) Subject: wip #6750 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d0536ed839e15f6ad3bc42d8c83077f110dea758;p=fluidbook_tools.git wip #6750 @0:20 --- diff --git a/src/SVG/SVGTools.php b/src/SVG/SVGTools.php index 9d44ee9..defb0ab 100644 --- a/src/SVG/SVGTools.php +++ b/src/SVG/SVGTools.php @@ -14,7 +14,7 @@ class SVGTools protected static $_e; protected static $_u; - public static function optimizeSVG($in, $out = null) + public static function optimizeSVG($in, $out = null, $opt = '') { if (!str_ends_with(mb_strtolower($in), '.svg')) { return $in; @@ -60,7 +60,7 @@ class SVGTools return $res; } - public static function _optimizeSVG($in, $out) + public static function _optimizeSVG($in, $out, $opt = '') { $beforeOpt = str_replace('.svg', '.orig.svg', $in); @@ -69,7 +69,7 @@ class SVGTools } copy($in, $beforeOpt); - $svg = shell_exec('timeout -s 1 120 ' . FluidbookTools::tools_path('svgcleaner/svgcleaner', true) . ' --allow-bigger-file --paths-coordinates-precision 3 --copy-on-error --stdout ' . $in); + $svg = shell_exec('timeout -s 1 120 ' . FluidbookTools::tools_path('svgcleaner/svgcleaner', true) . ' ' . $opt . ' --allow-bigger-file --paths-coordinates-precision 3 --copy-on-error --stdout ' . $in); if (!$svg) { $svg = file_get_contents($in); }