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"';