Resizes the image to the chosen size.

@param  int              $width       Width of the image
@param  int              $height      Height of the image
@param  int              $aspectRatio Aspect ratio
@return \mako\pixl\Image
176435
public function resize($width, $height = null, $aspectRatio = Image::RESIZE_IGNORE): Image
	{
		$this->processor->resize($width, $height, $aspectRatio);

		return $this;
	}
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;
        }
1036102
public function resize($width, $height)
    {
        $this->mode = 'resize';
        $this->targetSize = [$width, $height];
        $this->arguments = [];

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

            return $this;
        }
699395
public function Fit($width, $height)
    {
        $width = $this->castDimension($width, 'Width');
        $height = $this->castDimension($height, 'Height');
        // Item must be regenerated
        $variant = $this->variantName(__FUNCTION__, $width, $height);
        return $this->manipulateImage($variant, function (Image_Backend $backend) use ($width, $height) {
            // Check if image is already sized to the correct dimension
            $currentWidth = $backend->getWidth();
            $currentHeight = $backend->getHeight();
            if (!$currentWidth || !$currentHeight) {
                return null;
            }
            $widthRatio = $width / $currentWidth;
            $heightRatio = $height / $currentHeight;

            if ($widthRatio < $heightRatio) {
                // Target is higher aspect ratio than image, so check width
                if ($currentWidth === $width) {
                    return $this;
                }
            } else {
                // Target is wider or same aspect ratio as image, so check height
                if ($currentHeight === $height) {
                    return $this;
                }
            }

            return $backend->resizeRatio($width, $height);
        });
    }
253342
public function scale(Int $width, Int $height = -1, String $mode = 'bilinearFixed') : GD
    {
        $this->canvas = imagescale($this->canvas, $width, $height, Helper::toConstant($mode, 'IMG_'));

        return $this;
    }
387118
public function resize($width, $height)
    {
        //if the width is not specified, make it relative to the height
        if($width == -1){

            $this->width['dest'] = ($height * $this->width['orig']) / $this->height['orig'];
            $this->height['dest'] = $height;

        //if the height is not specified, make it relative to the width
        } elseif ($height == -1){

            $this->width['dest'] = $width;
            $this->height['dest'] = ($width * $this->height['orig']) / $this->width['orig'];

        } else {

            $this->width['dest'] = $width;
            $this->height['dest'] = $height;
        }

        //set resize code depending on the type of image it is
        switch ($this->type)

    {
            case "gif":
                $this->edited = imagecreate($this->width['dest'], $this->height['dest']);

                imagecopyresampled($this->edited, $this->original, 0, 0, 0, 0, $this->width['dest'], $this->height['dest'], $this->width['orig'], $this->height['orig']);

            break;

            case "jpg":
                $this->edited = imagecreatetruecolor($this->width['dest'], $this->height['dest']);

                imagecopyresampled($this->edited, $this->original, 0, 0, 0, 0, $this->width['dest'], $this->height['dest'], $this->width['orig'], $this->height['orig']);


            break;

            case "png":

                $this->edited = imagecreatetruecolor ($this->width['dest'], $this->height['dest']);

                //preserve the alpha if exists
                imagealphablending($this->edited, false);
                imagesavealpha($this->edited, true);

                imagecopyresampled($this->edited, $this->original, 0, 0, 0, 0, $this->width['dest'], $this->height['dest'], $this->width['orig'], $this->height['orig']);

            break;
        }

    }
1196295
public function resizeAndOrCrop($width, $height, $options) {
        if (!$width && !$height) return $this;
        if (isset($options['quadrant'])) return $this->cropQuadrant($width, $height, $options);
        if (array_key_exists('pad', $options)) $this->pad($width, $height, $options);
        if (array_key_exists('resize', $options) || !$width || !$height) return $this->resize($width, $height);
        return $this->crop($width, $height);
    }
1095511
public static function canvas($width, $height, $background = null)
    {
        return self::getManager()->canvas($width, $height, $background);
    }
266936
public function crop(int $width, int $height): self
    {
        $this->image = $this->cropImage($this->image, $width, $height);
        return $this;
    }
936540
public function resize(int $width = 0, int $height = 0)
    {
        if (!$width && !$height) {
            throw new ImageException('You must supply at least one dimension');
        }
        $iw = $this->info[0];
        $ih = $this->info[1];
        if (!$height || !$width) {
            if (!$width) {
                $width  = $height / $ih * $iw;
            }
            if (!$height) {
                $height = $width  / $iw * $ih;
            }
        }
        $di = imagecreatetruecolor($width, $height);
        imagecopyresized($di, $this->data, 0, 0, 0, 0, $width, $height, $iw, $ih);
        $this->data = $di;
    }
1057845
public function resize($width, $height)
    {
        return $this->createCloneWithResource(
            function (InterventionImage $resource) use ($width, $height) {
                return $resource->resize($width, $height);
            }
        );
    }
292826
protected function resizePortrait($file, $width, $height)
	{
		$image = $this->imagine
			->open($file->getRealPath());

		$dimensions = $image->getSize()
			->heighten($height);

		$image = $image->resize($dimensions);

		return $image;
	}
800986
public function resize($width, $height) {
		$image = imagecreatetruecolor($width, $height);
		imagealphablending($image, false);
		imagesavealpha($image, true);
		imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);
		imagedestroy($this->_image);
		$this->_image = $image;
		return $this;
	}
313005
public function resize($width = null, $height = null)
    {
        $this->styleAttributes['width'] = $width . 'px';
        $this->styleAttributes['height'] = $height . 'px';

        return $this;
    }
419610
protected function do_resize(\stdClass $src, $width, $height) {

		$src->resource->resizeImage($width, $height, \Imagick::FILTER_CATROM, 1, FALSE);
		$src->resource->convolveImage([-1, -0.8, -1, -0.8, 16, -0.8, -1, -0.8, -1]);
		
		$src->width		= $width;
		$src->height	= $height;

		return $src;
		
	}
1130336
public function forceResize($width = null, $height = null, $background = 'transparent')
    {
        return $this->resize($width, $height, $background, true);
    }