}
}
file_put_contents($textFile, $svg->saveXML());
- //return $svglog;
- }
-
- protected function _cleanSVG($svgFile, $page)
- {
- $svglog = self::cleanSVG($svgFile);
-
- $this->addToLog(implode("\n", $svglog), false, $page);
-
}
protected function checkObjectsNumber($file, $maxObjects, $page)
if ($optimize) {
- $cmd = "timeout -s 1 2 /usr/local/bin/svgcleaner --allow-bigger-file --paths-coordinates-precision 3 --copy-on-error --stdout $original";
+ $cmd = "timeout -s 1 10 /usr/local/bin/svgcleaner --allow-bigger-file --paths-coordinates-precision 3 --copy-on-error --stdout $original";
$svg = `$cmd`;
if ($svg == '') {
$svg = file_get_contents($original);
}
- $svg = substr_replace($svg, 'preserveAspectRatio="none" ', 5, 0);
+ $svg = substr_replace($svg, ' preserveAspectRatio="none" ', 5, 0);
$fname = $baseoptimized;
file_put_contents($fname, $svg);