]> _ Git - cubeextranet.git/commitdiff
wait #3959 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 16 Oct 2020 10:28:11 +0000 (10:28 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 16 Oct 2020 10:28:11 +0000 (10:28 +0000)
inc/ws/Metier/class.ws.book.php
inc/ws/Metier/class.ws.document.php
inc/ws/Util/class.ws.tools.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 747f28911f020c3809277ef2c6cf501841b72710..b76a736c9bb799208efcb62d0a47e6b9046660c3 100644 (file)
@@ -100,9 +100,7 @@ class wsBook extends cubeMetier
     {\r
         $thumbpdf = WS_BOOKS . '/working/' . $this->book_id . '/' . $this->parametres->pdfThumbnails;\r
         if ($this->parametres->pdfThumbnails && file_exists($thumbpdf)) {\r
-\r
-            return     wsPDFConvert::getThumbFromPDF($thumbpdf, $page, $format);\r
-\r
+            return wsPDFConvert::getThumbFromPDF($thumbpdf, $page, $format);\r
         }\r
         return $this->getFile($page, $format, 'thumb');\r
     }\r
index c16eb74db89c784d2edaa680a6952b36539a146b..21981f9a91458a18781d244d89f0e6c810690c25 100644 (file)
@@ -399,7 +399,6 @@ class wsDocument extends cubeMetier
             $version = '';
         }
 
-
         $dir = rtrim($this->out . $version, '/') . '/';
         $minsize = 1;
         if ($format === 'svg') {
@@ -423,7 +422,7 @@ class wsDocument extends cubeMetier
 
         $do = false;
         if (!file_exists($file)) {
-            if (isset($alt) && file_exists($alt)) {
+            if (isset($alt) && file_exists($alt) && filesize($alt)>$minsize) {
                 rename($alt, $file);
                 $do = false;
             } else {
index ff659c7e31a6c20b0f8692d2509f2c61c6edff9b..44d4da1e1767aee70e232f8253c07733bbda24df 100644 (file)
@@ -71,6 +71,7 @@ class wsTools
     public static function optimizeSVGImages($in, $out, $resolution)
     {
         $svg = file_get_contents($in);
+        $svg = preg_replace('/\<\?xml([^\?]*)\?\>/', '', $svg);
         $svg = substr_replace($svg, ' preserveAspectRatio="none" ', 5, 0);
 
         $osvg = preg_replace_callback('|\<image([^>]*)\>|', function ($matches) use ($resolution) {
index d156e3e8f5ee2ef5ca5cebda59278c7391ab2c89..971aea72e23c9887127f87a0a2e40fb3d26d5e97 100644 (file)
@@ -1829,13 +1829,13 @@ class wsHTML5Compiler
             }
 
             if ($thisimagesvg) {
-                $this->vdir->copy($this->book->getFile($page, 'svg', 150, true,
-                    in_array($page, $this->config->vectorPages), 'html'), 'data/contents/p' . $page . '.svg');
+                $this->vdir->copy(
+                    $this->book->getFile($page, 'svg', 150, true,
+                        in_array($page, $this->config->vectorPages), 'html')
+                    , 'data/contents/p' . $page . '.svg');
             }
 
-
-
-            $this->vdir->copy($this->book->getFile($page,$this->imageFormat,'thumb',true,true,'html'), 'data/thumbnails/p' . $page . '.' . $this->imageFormat);
+            $this->vdir->copy($this->book->getFile($page, $this->imageFormat, 'thumb', true, true, 'html'), 'data/thumbnails/p' . $page . '.' . $this->imageFormat);
 
             if ($page == 1) {
                 $this->_makeCover($docdir . 'html/t36-' . $infos['document_page'] . '.jpg');