]> _ Git - cubeextranet.git/commitdiff
#1475 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 15 Jun 2017 16:27:45 +0000 (16:27 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 15 Jun 2017 16:27:45 +0000 (16:27 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index e8056088812b9c64268a7361bb635af4d497edb1..36e920c7cde13794630fe9ed62484ac7fca8d387 100644 (file)
@@ -830,8 +830,6 @@ class wsHTML5Compiler {
                                $this->hiddenContents[] = $c;
                        }
                        $i++;
-
-                       $this->log('Link ' . $link->type . ' written');
                }
 
                $allpages = range(0, $this->book->parametres->pages + 1);
@@ -1092,9 +1090,10 @@ class wsHTML5Compiler {
                        $srcPrefix = 'h';
                }
                foreach ($this->pages as $page => $infos) {
+                       $docdir = wsDocument::getDir($infos['document_id']);
                        if ($this->svg) {
-                               $orig = wsDocument::getDir($infos['document_id']) . 'html/p' . $infos['document_page'] . '.svg';
-                               $opt = wsDocument::getDir($infos['document_id']) . 'html/o' . $infos['document_page'] . '.svg';
+                               $orig = $docdir . 'html/p' . $infos['document_page'] . '.svg';
+                               $opt = $docdir . 'html/o' . $infos['document_page'] . '.svg';
 
                                $svg = $orig;
                                if (file_exists($opt) && filesize($opt) > 0) {
@@ -1105,7 +1104,7 @@ class wsHTML5Compiler {
                        }
 
                        foreach ($this->getResolutions() as $r) {
-                               $ok = $this->copy(wsDocument::getDir($infos['document_id']) . 'html/' . $srcPrefix . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/' . $this->backgroundsPrefix . $page . '.jpg');
+                               $ok = $this->copy($docdir . 'html/' . $srcPrefix . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/' . $this->backgroundsPrefix . $page . '.jpg');
                                if (!$ok && $r = 300) {
                                        $this->maxRes = 150;
                                }
@@ -1116,15 +1115,17 @@ class wsHTML5Compiler {
                                $thumb = wsPDFConvert::getThumbFromPDF(WS_BOOKS . '/working/' . $this->book->book_id . '/' . $this->book->parametres->pdfThumbnails, $page);
                        }
                        if (!$thumb) {
-                               $thumb = wsDocument::getDir($infos['document_id']) . 'p' . $infos['document_page'] . '.jpg';
+                               $thumb = $docdir . 'p' . $infos['document_page'] . '.jpg';
                        }
 
 
                        $this->copy($thumb, $this->vdir . '/data/thumbnails/p' . $page . '.jpg');
 
                        if ($page == 1) {
-                               $this->_makeCover(wsDocument::getDir($infos['document_id']) . 'html/t36-' . $infos['document_page'] . '.jpg');
+                               $this->_makeCover($docdir . 'html/t36-' . $infos['document_page'] . '.jpg');
                        }
+
+                       $this->log('Copied image '.$page);
                }
        }
 
index f251fb3d8814c88e88550b8cc1c274a049b7041f..903dfc445d65b577e1508424ea1e90313976abb2 100644 (file)
@@ -1228,21 +1228,15 @@ class zoomLink extends normalLink {
        }
 
        public function generateImage() {
-               $this->compiler->log('Before generating image');
-
                $left = CubeIT_Files::tempnam();
 
                $p = wsDAOBook::getDocumentPage($this->compiler->book_id, $this->page);
-               $this->compiler->log('Got document page');
                $pdfpath = wsDocument::getDir($p['document_id']) . 'original.pdf';
-               $this->compiler->log('Got pdf original');
                $leftfile = CubeIT_CommandLine_Poppler::extractArea($pdfpath,
                        $p['document_page'],
                        array('x' => $this->left, 'y' => $this->top, 'width' => $this->width, 'height' => $this->height),
                        $left, array(), WS_CACHE . '/zoomarea/' . $this->compiler->book_id . '/');
 
-               $this->compiler->log('Left file generated');
-
                $bookwidth = $this->compiler->book->parametres->width;
 
                if (($this->left + $this->width) > $bookwidth) {
@@ -1255,18 +1249,13 @@ class zoomLink extends normalLink {
                                array('x' => 0, 'y' => $this->top, 'width' => $diff, 'height' => $this->height),
                                $right, array(), WS_CACHE . '/zoomarea/' . $this->compiler->book_id . '/');
 
-                       $this->compiler->log('Left file generated');
-
                        $both = CubeIT_Files::tempnam() . '.jpg';
                        CubeIT_CommandLine_Imagemagick::append(array($leftfile, $rightfile), $both, 'horizontal');
-
-                       $this->compiler->log('Both files assembled');
                } else {
                        $both = $leftfile;
                }
 
                $this->compiler->simpleCopyLinkFile($both, 'data/links/zoom_' . $this->id . '.jpg');
-               $this->compiler->log('Files copied');
 
                // Perform tidy up and delete temporary files if they exist
                $files_to_delete = ['left', 'leftfile', 'right', 'rightfile', 'both'];
@@ -1275,7 +1264,6 @@ class zoomLink extends normalLink {
                                unlink($$file);
                        }
                }
-               $this->compiler->log('Files cleaned up');
        }