]> _ Git - cubeextranet.git/commitdiff
fix #4250 @2
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 12 Feb 2021 11:44:32 +0000 (11:44 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 12 Feb 2021 11:44:32 +0000 (11:44 +0000)
inc/ws/Controlleur/class.ws.maintenance.php
inc/ws/Metier/class.ws.document.php
inc/ws/Util/class.ws.pdf.convert.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 390cc808ce8ff6d213b09d4979cdf61e5b6e8653..a387c1ce0ecf1d0fd709cb42833e382c742e378f 100644 (file)
@@ -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);
         }
index c5e19579853fbfb40c8ad65f8ba023e1447b38fd..0839cdbb1c94e5e3931f41aaa840dfe2f844d913 100644 (file)
@@ -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];
     }
 
index 2c364ac40ad64ae7c93779804fbd0b76c9cadc94..667174a150ba75ed17f595b88b0af1415cf84c04 100644 (file)
@@ -252,6 +252,10 @@ class wsPDFConvert
                 $pnmtopng->execute();\r
             }\r
             unlink($tmp);\r
+        }else{\r
+            $pdftoppm->debug();\r
+            echo $pdftoppm->command.':'.$pdftoppm->output;\r
+            exit;\r
         }\r
     }\r
 \r
index b1754ea908c4db6bcef8fd8d71cd3a83da645d06..fb488bd2725840a3ab3358a13f06a5b9754a8477 100644 (file)
@@ -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;