Returns true iff the crop is greater or equal to the size of a given format.

@param $width
@param $height
@param array $format

@return bool
773289
private function isNotSmallerThanFormat($width, $height, array $format)
    {
        if (isset($format['scale']['x']) && $width < $format['scale']['x']) {
            return false;
        }
        if (isset($format['scale']['y']) && $height < $format['scale']['y']) {
            return false;
        }

        return true;
    }
564521
public function resize($width, $height) {
        if (!$width) $width = 1;
        if (!$height) $height = 1;
        return (
            (false !== ($img = new gd(array($width, $height)))) &&
            $img->imagecopyresampled($this) &&
            (false !== ($this->image = $img->get_image())) &&
            (false !== ($this->width = $img->get_width())) &&
            (false !== ($this->height = $img->get_height()))
        );
    }
983752
public function Fill($width, $height)
    {
        $width = $this->castDimension($width, 'Width');
        $height = $this->castDimension($height, 'Height');
        $variant = $this->variantName(__FUNCTION__, $width, $height);
        return $this->manipulateImage($variant, function (Image_Backend $backend) use ($width, $height) {
            if ($backend->getWidth() === $width && $backend->getHeight() === $height) {
                return $this;
            }
            return $backend->croppedResize($width, $height);
        });
    }
997990
public function getNewDimensions($width, $height)
    {
        if(!$this->resizeSmaller && $this->height >= $height && $this->width >= $width)
        {
            return parent::getNewDimensions($width, $height);
        }

        if(in_array($this->resizeMode, array($this::MODE_CROP, $this::MODE_STRETCH, $this::MODE_EXACT)))
        {
            return parent::getNewDimensions($this->width, $this->height);
        }
        elseif($this->resizeMode === $this::MODE_FILL)
        {
            $ratioH = $this->height / $height;
            $ratioW = $this->width / $width;

            $widthFill  = max($width * $ratioH, $width * $ratioW);
            $heightFill = max($height * $ratioH, $height * $ratioW);
            $ratio = max($widthFill / $width, $heightFill / $height);

            return parent::getNewDimensions(round($width * $ratio), round($height * $ratio));
        }
        else
        {
            $pictureWidth  = $this->width;
            $pictureHeight = $this->height;

            if($width > $pictureWidth || $height > $pictureHeight)
            {
                if($width > $height)
                {
                    $pictureHeight = floor(($height / $width) * $pictureWidth);
                }
                elseif($width < $height)
                {
                    $pictureWidth = floor(($width / $height) * $pictureHeight);
                }
            }

            return parent::getNewDimensions($pictureWidth, $pictureHeight);
        }
    }
646567
public function getProsize(Int $width = 0, Int $height = 0)
    {
        if( ! isset($this->sets['filePath']) )
        {
            return false;
        }

        return $this->image->getProsize($this->sets['filePath'], $width, $height);
    }
170720
protected function isValid($width, $height, array $configuration)
    {
        if (isset($configuration['MinWidth']) && $this->validateConfig('MinWidth', $configuration)) {
            if ($width < $configuration['MinWidth']) {
                throw new ValidationException('Minimum width must be '.$configuration['MinWidth'].'px');
            }
        }

        if (isset($configuration['MaxWidth']) && $this->validateConfig('MaxWidth', $configuration)) {
            if ($width > $configuration['MaxWidth']) {
                throw new ValidationException('Maximum width must be '.$configuration['MaxWidth'].'px');
            }
        }

        if (isset($configuration['MinHeight']) && $this->validateConfig('MinHeight', $configuration)) {
            if ($height < $configuration['MinHeight']) {
                throw new ValidationException('Minimum height must be '.$configuration['MinHeight'].'px');
            }
        }

        if (isset($configuration['MaxHeight']) && $this->validateConfig('MaxHeight', $configuration)) {
            if ($height > $configuration['MaxHeight']) {
                throw new ValidationException('Minimum height must be '.$configuration['MaxHeight'].'px');
            }
        }

        $ratio = round($width / $height, 2);

        if (isset($configuration['MinRatio']) && $this->validateConfig('MinRatio', $configuration, true)) {
            if ($ratio < $configuration['MinRatio']) {
                throw new ValidationException('Minimum ratio must be '.$configuration['MinRatio']);
            }
        }

        if (isset($configuration['MaxRatio']) && $this->validateConfig('MaxRatio', $configuration, true)) {
            if ($ratio > $configuration['MaxRatio']) {
                throw new ValidationException('Maximum ratio must be '.$configuration['MaxRatio']);
            }
        }
    }
1115847
protected function calcImageSizeStrict($width, $height)
    {
        // first, we need to determine what the longest resize dimension is..
        if ($this->maxWidth >= $this->maxHeight) {
            // and determine the longest original dimension
            if ($width > $height) {
                $newDimensions = $this->calcHeight($width, $height);

                if ($newDimensions['newWidth'] < $this->maxWidth) {
                    $newDimensions = $this->calcWidth($width, $height);
                }
            } elseif ($height >= $width) {
                $newDimensions = $this->calcWidth($width, $height);

                if ($newDimensions['newHeight'] < $this->maxHeight) {
                    $newDimensions = $this->calcHeight($width, $height);
                }
            }
        } elseif ($this->maxHeight > $this->maxWidth) {
            if ($width >= $height) {
                $newDimensions = $this->calcWidth($width, $height);

                if ($newDimensions['newHeight'] < $this->maxHeight) {
                    $newDimensions = $this->calcHeight($width, $height);
                }
            } elseif ($height > $width) {
                $newDimensions = $this->calcHeight($width, $height);

                if ($newDimensions['newWidth'] < $this->maxWidth) {
                    $newDimensions = $this->calcWidth($width, $height);
                }
            }
        }

        $this->newDimensions = $newDimensions;
    }
625185
public function thumbizeByLimit( $width, $height )
	{
		if( !count( $this->size ) )
			throw new RuntimeException( 'No Source Image set.' );

		$ratio_s	= $this->size[0] / $this->size[1];
		$ratio_t	= $width / $height;
		if( ( $ratio_s / $ratio_t ) > 1 )
			$height	= ceil( $width / $ratio_s );
		else
			$width	= ceil( $height * $ratio_s );
		return $this->thumbize( $width, $height );
	}
1315581
public function resize_strict( $width, $height ) 
	{
		// check dimensions
		if ( !( $width > 0 ) || !( $height > 0 ) ) 
		{
			throw new CCException( "CCImage::resize_strict - width and height can't be smaller then 1" );
		}

		$result = imagecreatetruecolor( $width, $height );  
		imagecopyresampled( $result, $this->image_context, 0, 0, 0, 0, $width, $height, $this->width, $this->height ); 

		// overwrite the image context 
		$this->image_context = $result;

		// update properties
		$this->reload_context_info();

		// return self
		return $this;
	}
1265835
protected function _calcHeight($width, $height)
        {
            $newHeightRatio = $this->_maxHeight / $height;
            $newWidth = $width * $newHeightRatio;

            return array(round($newWidth), round($this->_maxHeight));
        }
1008906
protected function getNewHeight($width, $height) 
    {
        if ($height > 0) {
            return $height;
        }
        
        // original width : new width = original height : X
        return $width * $this->imageInfo['height'] / $this->imageInfo['width'];
    }
838752
public final function contains( Size $size ) : bool
   {

      return (
         ( $size->_width <= $this->_width )
         &&
         ( $size->_height <= $this->_height )
      );

   }
784593
public function setSize($width, $height)
    {
        $this->width = $width;
        $this->height = $height;
        $this->ratioX = $width / $height;
        $this->ratioY = $height / $width;

        return $this;
    }
61322
public function adaptiveResize($width, $height)
        {
            $this->resizeOut($width, $height);
            $this->crop(0, 0, $width, $height);

            return $this;
        }
174668
public static function isAboveMinWidth($check, $width)
    {
        // Non-file uploads also mean the height is too big
        if (!isset($check['tmp_name']) || !strlen($check['tmp_name'])) {
            return false;
        }
        list($imgWidth) = getimagesize($check['tmp_name']);

        return $width > 0 && $imgWidth >= $width;
    }
798207
protected function validateSize($width, $height)
    {
        if ($this->maximumHeight && $height > $this->maximumHeight) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_height_max'],
                $height,
                $this->maximumHeight
            ));
            return false;
        }

        if ($this->maximumWidth && $width > $this->maximumWidth) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_width_max'],
                $width,
                $this->maximumWidth
            ));
            return false;
        }

        if ($this->minimumHeight && $height < $this->minimumHeight) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_height_min'],
                $height,
                $this->minimumHeight
            ));
            return false;
        }

        if ($this->minimumWidth && $width < $this->minimumWidth) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_width_min'],
                $width,
                $this->minimumWidth
            ));
            return false;
        }

        return true;
    }
1366934
public function runMaxResize(Image $image, $width, $height)
    {
        return $image->resize($width, $height, function ($constraint) {
            $constraint->aspectRatio();
            $constraint->upsize();
        });
    }