From 22686fe8f6c237abf4b6b7ac0fb504180607fb48 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 16 Jan 2018 18:13:37 +0000 Subject: [PATCH] #1584 --- .../Util/html5/master/class.ws.html5.compiler.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 07df54000..0d15cdb48 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -246,6 +246,8 @@ class wsHTML5Compiler { public function initConfig() { $this->config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject()); + $this->config->rasterizePages = cubeArray::parseRange($this->config->rasterizePages); + $this->config->vectorPages = array_diff(cubeArray::parseRange($this->config->vectorPages), $this->config->rasterizePages); } public function log($step) { @@ -258,6 +260,7 @@ class wsHTML5Compiler { } $time = $currenttime - $this->logtime; $log = $step . ' | ' . round($time, 3) . 's' . "\n"; + $log = $step . ' | ' . round($time, 3) . 's' . "\n"; fwrite($this->logfp, $log); fflush($this->logfp); $this->logtime = $currenttime; @@ -1084,7 +1087,6 @@ class wsHTML5Compiler { $this->log("Done cart references"); } } - $this->config->rasterizePages = cubeArray::parseRange($this->config->rasterizePages); $this->config->seoArticles = $this->seoArticles; return 'var DATAS=' . json_encode($this->config) . ';' . "\n"; @@ -1153,6 +1155,7 @@ class wsHTML5Compiler { $docdir = wsDocument::getDir($infos['document_id']); if ($this->svg) { $full = $docdir . 'html/fp' . $infos['document_page'] . '.svg'; + $fullopt = $docdir . 'html/fo' . $infos['document_page'] . '.svg'; $orig = $docdir . 'html/tp' . $infos['document_page'] . '.svg'; $opt = $docdir . 'html/to' . $infos['document_page'] . '.svg'; @@ -1165,10 +1168,17 @@ class wsHTML5Compiler { } wsDocument::extractTexts($full, $orig); wsTools::optimizeSVG($orig, $opt); + wsTools::optimizeSVG($full, $fullopt); + - $this->vdir->copy($opt, 'data/contents/p' . $page . '.svg'); + if (in_array($page, $this->config->vectorPages)) { + $this->vdir->copy($fullopt, 'data/contents/p' . $page . '.svg'); + } else { + $this->vdir->copy($opt, 'data/contents/p' . $page . '.svg'); + } } + foreach ($this->getResolutions() as $r) { foreach ($this->backgroundsPrefix as $backgroundsPrefix) { $srcPrefix = $backgroundsPrefix; @@ -1200,6 +1210,7 @@ class wsHTML5Compiler { $this->log('Copied image ' . $page); } + $this->makeThumbSprites($thumbs); $this->log('Made thumbnails'); } -- 2.39.5