From 5aacf73379e9cbf75ee88a60f3c775f9a2bb0522 Mon Sep 17 00:00:00 2001 From: Spuds Date: Tue, 2 Apr 2024 13:54:59 -0500 Subject: [PATCH] ! Fix #3677, do not reszie the preview when not asked --- sources/ElkArte/Controller/Attachment.php | 7 ++++--- sources/ElkArte/IlaIntegrate.php | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sources/ElkArte/Controller/Attachment.php b/sources/ElkArte/Controller/Attachment.php index 142b9ac4ed..96940ce962 100644 --- a/sources/ElkArte/Controller/Attachment.php +++ b/sources/ElkArte/Controller/Attachment.php @@ -789,14 +789,15 @@ public function action_tmpattach() $this->prepare_headers($filename, $eTag, $mime_type, 'inline', $real_filename, $do_cache); - if ($resize) + // do not resize for ;image + if ($resize && !isset($this->_req->query->ila, $this->_req->query->image)) { // Create a thumbnail image $image = new Image($filename); $filename .= '_thumb'; - $max_width = $this->_req->isSet('thumb') && !empty($modSettings['attachmentThumbWidth']) ? $modSettings['attachmentThumbWidth'] : 250; - $max_height = $this->_req->isSet('thumb') && !empty($modSettings['attachmentThumbHeight']) ? $modSettings['attachmentThumbHeight'] : 250; + $max_width = $this->_req->isSet('thumb') && !empty($modSettings['attachmentThumbWidth']) ? $modSettings['attachmentThumbWidth'] : 300; + $max_height = $this->_req->isSet('thumb') && !empty($modSettings['attachmentThumbHeight']) ? $modSettings['attachmentThumbHeight'] : 300; $image->createThumbnail($max_width, $max_height, $filename, null, false); } diff --git a/sources/ElkArte/IlaIntegrate.php b/sources/ElkArte/IlaIntegrate.php index bd468e66ea..9c92c2c902 100644 --- a/sources/ElkArte/IlaIntegrate.php +++ b/sources/ElkArte/IlaIntegrate.php @@ -302,7 +302,7 @@ public static function buildTag() $alt = Util::htmlspecialchars($attachment['filename'] ?? 'X'); self::$typeTag = ' - ' . $alt . ' + ' . $alt . ' '; } // Not an image, determine a mime thumbnail or use a default thumbnail @@ -328,7 +328,7 @@ public static function buildTag() } /** - * This is prevents a little repetition and provides a some control for url tags + * This prevents a little repetition and provides a some control for url tags * * - Determines if the ILA is an image or not * - Keeps track of attachment usage to prevent displaying below the post