Skip to content

Commit c96c27e

Browse files
Chhandak.BaruaChhandak.Barua
Chhandak.Barua
authored and
Chhandak.Barua
committed
ACP2E-3127: imagecreatetruecolor(): Argument #2 () must be greater than 0. Can't upload specific image
1 parent 2da165c commit c96c27e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,13 +724,10 @@ public function resizeFile($source, $keepRatio = true)
724724
[$imageWidth, $imageHeight] = $this->getResizedParams($source);
725725
try {
726726
$image->resize($imageWidth, $imageHeight);
727-
}
728-
catch (\Throwable $e)
729-
{
730-
$this->logger->critical( 'FAILED WYSIWYG IMAGE RESIZING: ' . ' error: ' . $e->getMessage() . '. path: ' . $realPath );
727+
} catch (\Throwable $e) {
728+
$this->logger->critical('FAILED WYSIWYG IMAGE RESIZING: ' . ' error: ' . $e->getMessage() . '. path: ' . $realPath);
731729
return false;
732730
}
733-
$image->resize($imageWidth, $imageHeight);
734731
$dest = $targetDir . '/' . $this->ioFile->getPathInfo($source)['basename'];
735732
$image->save($dest);
736733
if ($this->_directory->isFile($this->_directory->getRelativePath($dest))) {

0 commit comments

Comments
 (0)