From ca17f8939c6b430867e1de39c2dd77f4d7949eff Mon Sep 17 00:00:00 2001 From: Ingolf Steinhardt Date: Sun, 27 Jul 2025 11:42:58 +0200 Subject: [PATCH] Fix file toolbox for lightbox output for not image files --- src/Helper/ToolboxFile.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Helper/ToolboxFile.php b/src/Helper/ToolboxFile.php index 72dbff703..af3f0a4b6 100644 --- a/src/Helper/ToolboxFile.php +++ b/src/Helper/ToolboxFile.php @@ -1153,6 +1153,9 @@ private function processFile($fileName) 'isPicture' => false, ]; + $information['lb'] = 'lb_' . $this->getLightboxId(); + $information['imageUrl'] = $fileName; + // Prepare GD images. if ($information['isGdImage'] = $file->isGdImage) { try { @@ -1163,8 +1166,6 @@ private function processFile($fileName) $information['isGdImage'] = false; } - $information['lb'] = 'lb_' . $this->getLightboxId(); - if ( file_exists($this->rootDir . '/' . $information['src']) && (false !== ($size = getimagesize($this->rootDir . '/' . $information['src']))) @@ -1173,14 +1174,11 @@ private function processFile($fileName) $information['h'] = $size[1]; $information['wh'] = $size[3]; } - - $information['imageUrl'] = $fileName; } // Prepare SVG images. if ($information['isSvgImage'] = $file->isSvgImage) { - $information['src'] = $fileName; - $information['imageUrl'] = $fileName; + $information['src'] = $fileName; } // Prepare the picture for provide the image size.