]> _ Git - fluidbook_tools.git/commitdiff
wip #7360 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Feb 2025 18:16:26 +0000 (19:16 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Feb 2025 18:16:26 +0000 (19:16 +0100)
src/Links/ZoomLink.php

index 0f06aca7ac7d7494e99cb55377601764b78baa2f..5dbcd287cea75a9b67860bd8c77630ca67d0bbd5 100644 (file)
@@ -184,7 +184,8 @@ class ZoomLink extends NormalLink
             null, $extractOptions, $cache);
 
         if (Files::isEmpty($leftfile)) {
-            throw new \Exception('Failed to generate image with ' . json_encode($attributes));
+            $compiler->addIssue(16, ['error' => 'Error while glueing left and right parts', 'uid' => $attributes['id'], 'page' => $attributes['page']]);
+            return null;
         }
 
         if ($attributes['page'] % 2 === 0 && ($x + $w) > ($bookwidth + 1) && $compiler->isDoublePage() && $attributes['page'] + 1 <= $compiler->getPageNumber()) {
@@ -215,7 +216,8 @@ class ZoomLink extends NormalLink
                 }
             }
             if (Files::isEmpty($both)) {
-                throw new \Exception('Error glueing ' . $leftfile . ' and ' . $rightfile);
+                $compiler->addIssue(16, ['error' => 'File empty', 'uid' => $attributes['id'], 'page' => $attributes['page']]);
+                return null;
             }
         } else {
             $both = $leftfile;
@@ -239,7 +241,8 @@ class ZoomLink extends NormalLink
 
 
         if (Files::isEmpty($both)) {
-            Log::error('Failed generate image ' . json_encode($attributes));
+            $compiler->addIssue(16, ['error' => 'File empty', 'uid' => $attributes['id'], 'page' => $attributes['page']]);
+            return null;
         }
         $dest = 'data/links/' . $save . '_' . $attributes['id'] . '.' . $ext;
         if ($copy) {