Skip to content

Commit

Permalink
ACP2E-3127: imagecreatetruecolor(): Argument #2 () must be greater th…
Browse files Browse the repository at this point in the history
…an 0. Can't upload specific image
  • Loading branch information
Chhandak.Barua authored and Chhandak.Barua committed Jul 19, 2024
1 parent 29fe909 commit ce05b97
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ce05b97

Please sign in to comment.