From 83a81cfef47852b8bb2a80ef6cd8ee6dd251e653 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 31 Mar 2023 17:49:42 +0200 Subject: [PATCH] wait #5611 --- src/Links/HTMLMultimediaPopupImage.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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"'; -- 2.39.5