From: Vincent Vanwaelscappel Date: Fri, 31 Mar 2023 15:49:42 +0000 (+0200) Subject: wait #5611 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=83a81cfef47852b8bb2a80ef6cd8ee6dd251e653;p=fluidbook_tools.git wait #5611 --- diff --git a/src/Links/HTMLMultimediaPopupImage.php b/src/Links/HTMLMultimediaPopupImage.php index c6528c1..ddf1246 100644 --- a/src/Links/HTMLMultimediaPopupImage.php +++ b/src/Links/HTMLMultimediaPopupImage.php @@ -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 = '
'; + $imgSizeAttrs = is_array($dim) ? ' data-width="' . $dim[0] . '" data-height="' . $dim[1] . '" width="' . $dim[0] . '" height="' . $dim[1] . '" ' : ''; + + $markup = '
'; $read = ''; if ($this->read_mode) { $read = ' data-readmode="1"';