Crop uploaded image to given width and height (in pixels).

@param  int       $width
@param  int       $height
@param  int|null  $x
@param  int|null  $y
@return $this
544764
public function crop($width, $height, $x = null, $y = null)
    {
        $this->toggleModified();

        $this->getInterventionImage()->crop($width, $height, $x, $y);

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

            return $this;
        }
16699
public function resize(int $width = 0, int $height = 0) : ImageInterface
    {
        $this->operations[] = [ __FUNCTION__, func_get_args() ];
        return $this;
    }
941821
public function resize($width, $height, $x = 0, $y = 0)
    {
        if ( !$this->newImage )
        {
            $this->create($width, $height);
        }

        if ( !is_numeric($width) ) {
            throw new \InvalidArgumentException('$width must be numeric');
        }

        if ( !is_numeric($height) ) {
            throw new \InvalidArgumentException('$height must be numeric');
        }

        $type = $this->source['type'];

        imagecopyresampled(
            $this->newImage,
            $this->sourceImage,
            0, 0,
            $x, $y,
            $width, $height,
            $this->source['width'], $this->source['height']);

        return $this;
    }
693954
public function resize($width, $height) {
		$image = imagecreatetruecolor($width, $height);
		imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);
		imagedestroy($this->_image);
		$this->_image = $image;
		return $this;
	}
52234
public function crop($width, $height, $gravity, $background = null)
    {
        $this->mode = 'crop';
        $this->targetSize = [$width, $height];
        $this->arguments = [$gravity, $background];

        return $this->process();
    }
1324540
public function crop($width, $height, $offestX = 0, $offestY = 0)
    {
        $pointer = new Point($offestX, $offestY);
        $size = new Box($width, $height);

        $this->image->crop($pointer, $size);

        return $this;
    }
1278581
public function dimension($width, $height = 0): self
    {
        if (empty($height)) {
            $height = $width;
        }

        return $this->set('dimension', compact('width', 'height'));
    }
157131
public function setResolution($width, $height)
    {
        $this->width = $width;
        $this->height = $height;
        return $this;
    }
550615
public function cropAndResizeFromCenter($width, $height)
        {
            $this->resizeOut($width, $height);
            $this->cropFromCenter($width, $height);

            return $this;
        }
449110
public function setViewportSize($width, $height)
    {
        $this->viewportWidth  = (int) $width;
        $this->viewportHeight = (int) $height;

        return $this;
    }
608590
public function focalCrop(int $width, int $height, int $focalX, int $focalY)
    {
        $this->width($width);
        $this->height($height);

        return $this->addManipulation('crop', "crop-{$focalX}-{$focalY}");
    }
235489
public function resizeOut($width, $height)
        {
            if (false === $this->_options['resizeUp']) {
                $this->_maxHeight = (intval($height) > $this->_sourceHeight) ? $this->_sourceHeight:$height;
                $this->_maxWidth = (intval($width) > $this->_sourceWidth) ? $this->_sourceWidth:$width;
            } else {
                $this->_maxHeight = intval($height);
                $this->_maxWidth = intval($width);
            }

            list($newWidth, $newHeight) = $this->_calcImageSizeStrict($this->_sourceWidth, $this->_sourceHeight);

            // resize the image to be close to our desired dimensions
            $this->resizeIn($newWidth, $newHeight);

            return $this;
        }
774659
public function setSize($width = 0, $height = 0)
    {
        if (!empty($width) && !empty($height)) {
            $this->width = $this->boxWidth = $width;
            $this->height = $this->boxHeight = $height;
        }

        return $this;
    }
57648
public function newImage($width, $height, $background = 'white')
    {
        $this->resource->createNew($width, $height, $background);

        return $this;
    }
383214
protected function doCropResized($width, $height, $x, $y)
  {
    $w = $this->getWidth();
    $h = $this->getHeight();

    if (($h / ($w / $width)) < $height) {
      $this->doResize(null, $height);
    } else {
      $this->doResize($width, null);
    }

    return $this->doCrop($width, $height, $x, $y);
  }
10381
public function size(Int $width, Int $height) : Thumb
    {
        $this->sets['width']  = $width;
        $this->sets['height'] = $height;

        return $this;
    }