From 9d525d08a34995497ac91a49edc9ca0409fa2f26 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 28 Feb 2025 19:16:26 +0100 Subject: [PATCH] wip #7360 @0.25 --- src/Links/ZoomLink.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Links/ZoomLink.php b/src/Links/ZoomLink.php index 0f06aca..5dbcd28 100644 --- a/src/Links/ZoomLink.php +++ b/src/Links/ZoomLink.php @@ -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) { -- 2.39.5