]> _ Git - fluidbook_tools.git/commitdiff
wip #6750 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 23 Feb 2024 16:33:42 +0000 (17:33 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 23 Feb 2024 16:33:42 +0000 (17:33 +0100)
src/SVG/SVGTools.php

index 9d44ee90fee51262f51890258955fc693d28ceb6..defb0ab0215064cac3597c666c34e32f7b6bc378 100644 (file)
@@ -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);
         }