From c96c27e6d10981f4834ace65dacf4a6af33ad48b Mon Sep 17 00:00:00 2001 From: "Chhandak.Barua" Date: Mon, 22 Jul 2024 18:36:17 +0530 Subject: [PATCH] ACP2E-3127: imagecreatetruecolor(): Argument #2 () must be greater than 0. Can't upload specific image --- app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 91ecd91f5c342..5cd4277ae48cc 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -724,13 +724,10 @@ public function resizeFile($source, $keepRatio = true) [$imageWidth, $imageHeight] = $this->getResizedParams($source); try { $image->resize($imageWidth, $imageHeight); - } - catch (\Throwable $e) - { - $this->logger->critical( 'FAILED WYSIWYG IMAGE RESIZING: ' . ' error: ' . $e->getMessage() . '. path: ' . $realPath ); + } catch (\Throwable $e) { + $this->logger->critical('FAILED WYSIWYG IMAGE RESIZING: ' . ' error: ' . $e->getMessage() . '. path: ' . $realPath); return false; } - $image->resize($imageWidth, $imageHeight); $dest = $targetDir . '/' . $this->ioFile->getPathInfo($source)['basename']; $image->save($dest); if ($this->_directory->isFile($this->_directory->getRelativePath($dest))) {