public $x;
public $ftpPassiveMode = false;
- const VINCENT = "paris.cubedesigners.com";
+ //const VINCENT = "paris.cubedesigners.com";
+ const VINCENT = "tortuga.enhydra.fr";
public function exportCollection($collectionId, $os)
{
$webvideo->execute();
}
- public static function optimizeSVG($in, $out)
+
+ public static function optimizeSVG($in, $out = null)
+ {
+ if (null === $out) {
+ $e = explode('.', $in);
+ $ext = array_pop($e);
+ array_push($e, 'o');
+ array_push($e, $ext);
+ $out = implode('.', $e);
+ }
+
+ if (file_exists($out) && filemtime($in) <= filemtime($out)) {
+ return;
+ }
+ return self::_optimizeSVG($in, $out);
+ }
+
+ public static function _optimizeSVG($in, $out)
{
$cmd = "timeout -s 1 120 /usr/local/bin/svgcleaner --allow-bigger-file --paths-coordinates-precision 3 --copy-on-error --stdout $in";
$svg = `$cmd`;
}
$svg = self::_disablePreserveRatio($svg);
file_put_contents($out, $svg);
+ return $out;
}
protected static function _disablePreserveRatio($in)
protected function addSVGSymbolFromFile($svg, $symbolName)
{
+ $svg = wsTools::optimizeSVG($svg);
+
$xml = simplexml_load_string(file_get_contents($svg));
$viewBox = (string)$xml['viewBox'];