From: vincent@cubedesigners.com Date: Fri, 12 Feb 2021 11:44:32 +0000 (+0000) Subject: fix #4250 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e5141cdf588f7ea5309633beb2e5e49e9ceb5ba3;p=cubeextranet.git fix #4250 @2 --- diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 390cc808c..a387c1ce0 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -1498,7 +1498,6 @@ class wsMaintenance ['svg', '200', true, true, 'html'], ]; - foreach ($files as $file) { $book->getFile($page, $file[0], $file[1], $file[2], $file[3], $file[4], true); } diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index c5e195798..0839cdbb1 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -89,6 +89,14 @@ class wsDocument extends cubeMetier } } + + public function checkInfos() + { + if (null === $this->generalInfos) { + $this->getInfos(null, true); + } + } + public function getCroppedPDF() { if (!file_exists($this->cropped)) { @@ -444,6 +452,7 @@ class wsDocument extends cubeMetier if ($do || $force) { $this->makeFile($file, $page, $format, $resolution, $withText, $withGraphics, $version); } + return $file; } @@ -557,6 +566,7 @@ class wsDocument extends cubeMetier public function getResolutionRatio() { + $this->checkInfos(); $a4surface = 500990; // en pt² $docSurface = $this->generalInfos['size'][0] * $this->generalInfos['size'][1]; // en pt² // to have the same surface resulting in px, we have to sqrt the ratio between the two surfaces defined above @@ -565,6 +575,7 @@ class wsDocument extends cubeMetier public function getMobileFirstRatio() { + $this->checkInfos(); return 620 / $this->generalInfos['size'][0]; } diff --git a/inc/ws/Util/class.ws.pdf.convert.php b/inc/ws/Util/class.ws.pdf.convert.php index 2c364ac40..667174a15 100644 --- a/inc/ws/Util/class.ws.pdf.convert.php +++ b/inc/ws/Util/class.ws.pdf.convert.php @@ -252,6 +252,10 @@ class wsPDFConvert $pnmtopng->execute(); } unlink($tmp); + }else{ + $pdftoppm->debug(); + echo $pdftoppm->command.':'.$pdftoppm->output; + exit; } } 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 b1754ea90..fb488bd27 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -287,6 +287,7 @@ class wsHTML5Compiler $daoDoc = new wsDAODocument($core->con); $firstDoc = $daoDoc->selectById($this->pages[1]['document_id']); + $firstDoc->checkInfos(); $size = $firstDoc->generalInfos['size']; $this->log('Got data from database'); @@ -2097,8 +2098,6 @@ class wsHTML5Compiler $cssHeight = $this->cssHeight; $cssScale = $this->cssScale; $w2 = ($cssWidth * 2) . 'px'; - - $h = $cssHeight . 'px'; $wm = ($this->width * $this->multiply) . 'px'; @@ -2112,6 +2111,7 @@ class wsHTML5Compiler $this->lessVariables['z'] = $this->z; $this->lessVariables['book-page-width'] = $w; + if ($this->book->parametres->correctCenter && !$this->isMobileFirst()) { $this->lessVariables['book-page-correct-width'] = ceil($w) + 1; $this->lessVariables['book-page-correct-height'] = ceil($h) + 1;