From 9c176a63956390aeb540f132171ae92a27e47291 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 7 Jun 2023 12:05:40 +0200 Subject: [PATCH] wip #6002 @0:20 --- src/Links/HTMLMultimediaPopupImage.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Links/HTMLMultimediaPopupImage.php b/src/Links/HTMLMultimediaPopupImage.php index ddf1246..c3860d6 100644 --- a/src/Links/HTMLMultimediaPopupImage.php +++ b/src/Links/HTMLMultimediaPopupImage.php @@ -14,9 +14,17 @@ class HTMLMultimediaPopupImage extends NormalLink { return '#/multimedia/' . $read . md5($this->to . '/' . $this->extra . '/' . $this->id); } + /** + * @throws \Exception + */ public function getAdditionnalContent() { $res = parent::getAdditionnalContent(); - $dim = Image::getimagesize($this->compiler->working_path($this->to)); + $path = $this->compiler->working_path($this->to); + try { + $dim = Image::getimagesize($path); + }catch (\Exception $e){ + throw new \Exception('Invalid image on link ' . $this->uid . ' (page ' . $this->page . ') : '.$e->getMessage()); + } if (is_array($dim) && ($this->video_width || $this->video_height)) { $dim = Resizer::keepRatio($dim[0], $dim[1], $this->video_width, $this->video_height); -- 2.39.5