From 6857200634f2f097d8abfbd615060dc7eed64e0e Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 24 Jun 2024 16:52:55 +0200 Subject: [PATCH] Resize the image only if it exists --- Helper/Media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Helper/Media.php b/Helper/Media.php index 95e0558..05d70d7 100644 --- a/Helper/Media.php +++ b/Helper/Media.php @@ -201,7 +201,7 @@ public function resizeImage($file, $size, $type = '', $keepRatio = true) $mediaDirectory = $this->getMediaDirectory(); if ($mediaDirectory->isFile($resizeImage)) { $image = $resizeImage; - } elseif (!$mediaDirectory->isExist($mediaDirectory->getAbsolutePath($image))) { + } elseif ($mediaDirectory->isExist($mediaDirectory->getAbsolutePath($image))) { $imageResize = $this->imageFactory->create(); $imageResize->open($mediaDirectory->getAbsolutePath($image)); $imageResize->constrainOnly(true);