]> _ Git - cubeextranet.git/commitdiff
#1584
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 16 Jan 2018 18:13:37 +0000 (18:13 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 16 Jan 2018 18:13:37 +0000 (18:13 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 07df54000774c9a05c304ef84a3cbf88b24a8130..0d15cdb48acca18d9169b831ba69077fc3e928ef 100644 (file)
@@ -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');
        }