Resize the image, if one dimension is skipped it will be automatically calculated.
@param  int|integer $width  the width of the resized image
@param  int|integer $height the height of the resized image
501575
public function resize(int $width = 0, int $height = 0)
    {
        $this->instance->scaleImage($width, $height);
    }
250187
protected function getNewWidth($width, $height) 
    {
        if ($width > 0) {
            return $width;
        }
        
        // original height : new height = original width : X
        return $height * $this->imageInfo['width'] / $this->imageInfo['height'];
    }
1051075
public function resize($width, $height)
    {
        $newImage = imagecreatetruecolor($width, $height);

        $this->strategy->handleTransparency($newImage, $this->image);

        // Now resample the image
        imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());

        // And allocate to $this
        $this->image = $newImage;
    }
981987
public function resize($width, $height, $filename = null)
    {
        $this->resize[] = array('width'=>$width, 'height'=>$height,  'filename'=>$filename);

        return $this;
    }
119929
public function resizeWindow($width, $height)
    {
        $this->webDriver->manage()->window()->setSize(new WebDriverDimension($width, $height));
    }
458287
protected function resizeExact(ImageInterface $image, $width, $height)
    {
        return $image->resize(new Box($width, $height));
    }
453548
private function updateImageInfo($width, $height) {
		$this->_image_info[0] = $width;
		$this->_image_info[1] = $height;
		$this->_image_info[3] = 'width="' . $width . '" height="' . $height . '"';
		$this->_image_info['aspect'] = $width / $height;
	}
574461
public function resizeWindow($width, $height, $name = null)
    {
        $this->driver->resizeWindow($width, $height, $name);
    }
507478
public function do_resize($width, $height)
    {
        if (version_compare(PHP_VERSION, '5.5.0') < 0) {
            $image = imagecreatetruecolor($width, $height);
            imagealphablending($image, false);
            imagesavealpha($image, true);

            imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $this->_width, $this->_height);
        } else {
            $image = imagescale($this->_image, $width, $height);
        }

        imagedestroy($this->_image);
        $this->_image = $image;
        $this->_width = imagesx($image);
        $this->_height = imagesy($image);

        return $this;
    }
550615
public function cropAndResizeFromCenter($width, $height)
        {
            $this->resizeOut($width, $height);
            $this->cropFromCenter($width, $height);

            return $this;
        }
814618
private function simpleCrop($width, $height) {
        $sourceRatio = $this->image->getWidth() / $this->image->getHeight();
        $cropRatio = $width / $height;

        $params = [];

        if ($cropRatio > $sourceRatio) {
            $params['width'] = $width;
        } else {
            $params['height'] = $height;
        }

        $transformationManager = $this->event->getTransformationManager();

        $maxSize = $transformationManager->getTransformation('maxSize');
        $maxSize->setImage($this->image)->transform($params);

        $crop = $transformationManager->getTransformation('crop');
        $crop->setImage($this->image)->transform([
            'width' => $width,
            'height' => $height,
            'mode' => 'center'
        ]);
    }
677196
public function cropAndResize($width, $height, $gravity)
    {
        $this->mode = 'cropResize';
        $this->targetSize = [$width, $height];
        $this->arguments = [$gravity];

        return $this->process();
    }
914723
public function runFillResize($image, $width, $height)
    {
        $image = $this->runMaxResize($image, $width, $height);

        return $image->resizeCanvas($width, $height, 'center');
    }
1178832
public function resize($width, $height, $scale = null)
	{
		if (null == $scale) {
			$scale = self::SCALE_AUTO;
		}
		
		$xy_scales = array(self::SCALE_EXACT, self::SCALE_CROP);
		if (in_array($scale, $xy_scales) && (empty($width) || empty($height))) {
			throw new Exception('Width and height must be non-zero integers');
		}
		else if (empty($width) && empty($height)) {
			throw new Exception('Width or height must be a non-zero integer');
		}
		
		$orig_x = $this->width();
		$orig_y = $this->height();
		
		// Handle auto scaling.
		if ($scale == self::SCALE_AUTO) {
			if (empty($height)) {
				$scale = self::SCALE_LANDSCAPE;
			}
			else if (empty($width)) {
				$scale = self::SCALE_PORTRAIT;
			}
			else if ($orig_y < $orig_x) {
				$scale = self::SCALE_LANDSCAPE;
			}
			else if ($orig_y > $orig_x) {
				$scale = self::SCALE_PORTRAIT;
			}
			else if ($height < $width) {
				$scale = self::SCALE_EXACT;
				$height = $width;
			}
			else {
				$scale = self::SCALE_EXACT;
				$width = $height;
			}
		}
		
		switch ($scale) {
			case self::SCALE_EXACT:
				break;
				
			case self::SCALE_PORTRAIT:
				$width = round($height * ($orig_x / $orig_y));
				$height = $height;
				break;
				
			case self::SCALE_LANDSCAPE:
				$height = round($width * ($orig_y / $orig_x));
				break;
				
			case self::SCALE_CROP:
				$given_width = $width;
				$given_height = $height;
				
				$ratio = max($height / $orig_y, $width / $orig_x);
				
				$height = round($orig_y * $ratio);
				$width  = round($orig_x * $ratio);
				break;
		}
		
		$new_image = imagecreatetruecolor($width, $height);
		$white = imagecolorallocate($new_image, 255, 255, 255);
		imagefill($new_image, 0, 0, $white);
		imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $orig_x, $orig_y);
		$this->image = $new_image;
		
		if ($scale == self::SCALE_CROP) {
			// Crop to the center.
			if ($width > $height) {
				$crop_start_x = ($width / 2) - ($given_width / 2);
				$crop_start_y = 0;
			}
			else {
				$crop_start_x = 0;
				$crop_start_y = ($height / 2) - ($given_height / 2);
			}
			
			$new_image = imagecreatetruecolor($given_width, $given_height);
			$white = imagecolorallocate($new_image, 255, 255, 255);
			imagefill($new_image, 0, 0, $white);
			imagecopyresampled(
				$new_image, $this->image, 0, 0, $crop_start_x, $crop_start_y,
				$given_width, $given_height, $given_width, $given_height
			);
			$this->image = $new_image;
		}
		
		return $this;
	}
716267
public function resize(Int $width, Int $height) : Thumb
    {
        $this->sets['rewidth']  = $width;
        $this->sets['reheight'] = $height;

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

        return $this->set('dimension', compact('width', 'height'));
    }
602815
public function windowSize($width,$height)
    {
        $this->windowWidth  = $width;
        $this->windowHeight = $height;
        return $this;
    }