]> _ Git - fluidbook_tools.git/commitdiff
wip #6002 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Jun 2023 10:05:40 +0000 (12:05 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Jun 2023 10:05:40 +0000 (12:05 +0200)
src/Links/HTMLMultimediaPopupImage.php

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