From: vincent@cubedesigners.com Date: Thu, 1 Jun 2023 09:37:44 +0000 (+0000) Subject: wait #5977 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8d0a9aedeaa6bda8c3e39904a67b695675b388c8;p=cubeextranet.git wait #5977 @0.25 --- diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index e565160ff..e49085461 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -2976,21 +2976,27 @@ class zoomLink extends normalLink $extractPage = $attributes['page'] + 1; } - $diff = ($w + $x) - $bookwidth; - $right = CubeIT_Files::tempnam(); - $rightfile = CubeIT_CommandLine_Poppler::extractArea($pdfpath, - $extractPage, - array('x' => 0, 'y' => $y, 'width' => $diff, 'height' => $h), - $right, $extractOptions, wsBook::getCacheDir($compiler->book_id) . $cachedir . '/' . $compiler->book_id . '/'); - - if (!file_exists($rightfile)) { - die('Error generating right part ' . $rightfile); - } - $both = CubeIT_Files::tempnam() . '.jpg'; - CubeIT_CommandLine_Imagemagick::append(array($leftfile, $rightfile), $both, 'horizontal'); - if (!file_exists($both)) { - die('Error glueing ' . $leftfile . ' and ' . $rightfile); + if (!file_exists($pdfpath)) { + $both = $leftfile; + } else { + + $diff = ($w + $x) - $bookwidth; + $right = CubeIT_Files::tempnam(); + $rightfile = CubeIT_CommandLine_Poppler::extractArea($pdfpath, + $extractPage, + array('x' => 0, 'y' => $y, 'width' => $diff, 'height' => $h), + $right, $extractOptions, wsBook::getCacheDir($compiler->book_id) . $cachedir . '/' . $compiler->book_id . '/'); + + if (!file_exists($rightfile)) { + die('Error generating right part ' . $rightfile); + } + + $both = CubeIT_Files::tempnam() . '.jpg'; + CubeIT_CommandLine_Imagemagick::append(array($leftfile, $rightfile), $both, 'horizontal'); + if (!file_exists($both)) { + die('Error glueing ' . $leftfile . ' and ' . $rightfile); + } } } else { $both = $leftfile;