From: vincent@cubedesigners.com Date: Fri, 16 Oct 2020 10:28:11 +0000 (+0000) Subject: wait #3959 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=73065253b4a5a24b11693b16412fd55e19f912a3;p=cubeextranet.git wait #3959 @0.5 --- diff --git a/inc/ws/Metier/class.ws.book.php b/inc/ws/Metier/class.ws.book.php index 747f28911..b76a736c9 100644 --- a/inc/ws/Metier/class.ws.book.php +++ b/inc/ws/Metier/class.ws.book.php @@ -100,9 +100,7 @@ class wsBook extends cubeMetier { $thumbpdf = WS_BOOKS . '/working/' . $this->book_id . '/' . $this->parametres->pdfThumbnails; if ($this->parametres->pdfThumbnails && file_exists($thumbpdf)) { - - return wsPDFConvert::getThumbFromPDF($thumbpdf, $page, $format); - + return wsPDFConvert::getThumbFromPDF($thumbpdf, $page, $format); } return $this->getFile($page, $format, 'thumb'); } diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index c16eb74db..21981f9a9 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -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 { diff --git a/inc/ws/Util/class.ws.tools.php b/inc/ws/Util/class.ws.tools.php index ff659c7e3..44d4da1e1 100644 --- a/inc/ws/Util/class.ws.tools.php +++ b/inc/ws/Util/class.ws.tools.php @@ -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('|\]*)\>|', function ($matches) use ($resolution) { 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 d156e3e8f..971aea72e 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -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');