diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 71e7949000826..91ecd91f5c342 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -722,7 +722,14 @@ public function resizeFile($source, $keepRatio = true) $image->keepAspectRatio($keepRatio); [$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 ); + return false; + } $image->resize($imageWidth, $imageHeight); $dest = $targetDir . '/' . $this->ioFile->getPathInfo($source)['basename']; $image->save($dest);