]> _ Git - fluidbook_tools.git/commitdiff
wait #5611
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 31 Mar 2023 15:49:42 +0000 (17:49 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 31 Mar 2023 15:49:42 +0000 (17:49 +0200)
src/Links/HTMLMultimediaPopupImage.php

index c6528c10eb77b64e19881157ce8e1956764f1b6c..ddf1246ddebfd4f84955e7a3df86cd32df783654 100644 (file)
@@ -17,12 +17,14 @@ class HTMLMultimediaPopupImage extends NormalLink {
     public function getAdditionnalContent() {
         $res = parent::getAdditionnalContent();
         $dim = Image::getimagesize($this->compiler->working_path($this->to));
-        if ($this->video_width || $this->video_height) {
-            $dim = Resizer::keepRatio($dim[0], $dim[1], $this->video_width, $this->video_height);
 
+        if (is_array($dim) && ($this->video_width || $this->video_height)) {
+            $dim = Resizer::keepRatio($dim[0], $dim[1], $this->video_width, $this->video_height);
         }
 
-        $markup = '<div class="multimediaContainer" data-click-to-close="' . $this->clickToClose . '"><img data-width="' . $dim[0] . '" data-height="' . $dim[1] . '" src="' . Link::getUniversalLocation($this->to) . '" width="' . $dim[0] . '" height="' . $dim[1] . '" class="multimedia" /></div>';
+        $imgSizeAttrs = is_array($dim) ? ' data-width="' . $dim[0] . '" data-height="' . $dim[1] . '"  width="' . $dim[0] . '" height="' . $dim[1] . '" ' : '';
+
+        $markup = '<div class="multimediaContainer" data-click-to-close="' . $this->clickToClose . '"><img ' . $imgSizeAttrs . ' src="' . Link::getUniversalLocation($this->to) . '" class="multimedia" /></div>';
         $read = '';
         if ($this->read_mode) {
             $read = ' data-readmode="1"';