From b38e71e54402348ef1f5153dd446822cccb13485 Mon Sep 17 00:00:00 2001 From: Miguel Dantas Date: Mon, 19 Aug 2019 01:41:19 +0100 Subject: [PATCH] [Embed] Only resize thumbnail if it's bigger than the desired size --- plugins/Embed/EmbedPlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Embed/EmbedPlugin.php b/plugins/Embed/EmbedPlugin.php index 959bc6a068..7e293c3cea 100644 --- a/plugins/Embed/EmbedPlugin.php +++ b/plugins/Embed/EmbedPlugin.php @@ -576,10 +576,10 @@ class EmbedPlugin extends Plugin } // If the image is not of the desired size, resize it - if ($info[0] !== $this->thumbnail_width || $info[1] !== $this->thumbnail_height) { + if ($info[0] > $this->thumbnail_width || $info[1] > $this->thumbnail_height) { // Temporary object, not stored in DB $img = new ImageFile(-1, $fullpath); - $box = $img->scaleToFit($width, $height, $this->thumbnail_crop); + $box = $img->scaleToFit($this->thumbnail_width, $this->thumbnail_height, $this->thumbnail_crop); $outpath = $img->resizeTo($fullpath, $box); $filename = basename($outpath); if ($fullpath !== $outpath) {