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 Aug 1, 2024
1 parent 5c0fc10 commit b3a09c8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/**
* Image abstract adapter
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @SuppressWarnings(PHPMD.TooManyFields)
*/
Expand All @@ -27,25 +28,25 @@ abstract class AbstractAdapter implements AdapterInterface
* Position constants.
* Used mainly for watermarks
*/
const POSITION_TOP_LEFT = 'top-left';
public const POSITION_TOP_LEFT = 'top-left';

const POSITION_TOP_RIGHT = 'top-right';
public const POSITION_TOP_RIGHT = 'top-right';

const POSITION_BOTTOM_LEFT = 'bottom-left';
public const POSITION_BOTTOM_LEFT = 'bottom-left';

const POSITION_BOTTOM_RIGHT = 'bottom-right';
public const POSITION_BOTTOM_RIGHT = 'bottom-right';

const POSITION_STRETCH = 'stretch';
public const POSITION_STRETCH = 'stretch';

const POSITION_TILE = 'tile';
public const POSITION_TILE = 'tile';

const POSITION_CENTER = 'center';
public const POSITION_CENTER = 'center';
/**#@-*/

/**
* The size of the font to use as default
*/
const DEFAULT_FONT_SIZE = 15;
public const DEFAULT_FONT_SIZE = 15;

/**
* @var int
Expand Down Expand Up @@ -627,7 +628,7 @@ protected function _checkDimensions($frameWidth, $frameHeight)
{
if ($frameWidth !== null && $frameWidth <= 0 ||
$frameHeight !== null && $frameHeight <= 0 ||
empty($frameWidth) && empty($frameHeight)
($frameWidth === '' && $frameHeight === '')
) {
//phpcs:ignore Magento2.Exceptions.DirectThrow
throw new \InvalidArgumentException('Invalid image dimensions.');
Expand Down

0 comments on commit b3a09c8

Please sign in to comment.