]> _ Git - cubeextranet.git/commitdiff
wait #5977 @0.25
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 1 Jun 2023 09:37:44 +0000 (09:37 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 1 Jun 2023 09:37:44 +0000 (09:37 +0000)
inc/ws/Util/html5/master/class.ws.html5.links.php

index e565160ffabb3ca3deddccafa2efd451f91e07e0..e490854611fede16949eaa24e8661e13651f3729 100644 (file)
@@ -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;