Resize the image to the given width and height
@param width
@param height
@return
556127
public ImageHandlerBuilder resize(int width, int height) {
         BufferedImage resize = Scalr.resize(image, Scalr.Mode.FIT_EXACT, width, height);
         image.flush();
         image = resize;
         return this;
     }
185618
public function resize($image, $width = null, $height = null, $options = [])
    {
        if (!$this->fileExists($image)) {
            return $this->getMediaImageUrl($image);
        }
        
        $resizedImage = 'resized/' . $width . 'x' . $height . '/' . $image;
        if (!$this->fileExists($resizedImage)) {
            $imageResize = $this->setup($image, $width, $height, $options);
            $imageResize->resize($width, $height);
            $imageResize->save($this->getMediaDirectory()->getAbsolutePath($resizedImage));
        }
        
        return $this->getMediaImageUrl($resizedImage);
    }
1145016
public function resize_overflow($width, $height) {

        $big = (($this->width / $this->height) > ($width / $height))
            ? ($this->width * $height) / $this->height
            : ($this->height * $width) / $this->width;
        $big = intval($big);

        $return = ($img = new gd($this->image, $big));

        if ($return) {
            $this->image = $img->get_image();
            $this->width = $img->get_width();
            $this->height = $img->get_height();
        }

        return $return;
    }
973922
public function resize($width, $height)
    {

        $new = imagecreatetruecolor($width, $height);
        imagealphablending($new, false);
        imagesavealpha($new, true);
        imagecopyresampled($new, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);

        $this->width = $width;
        $this->height = $height;
        $this->image = $new;

        return $this;

    }
524066
public ImageHandlerBuilder resizeToWidth(int size) {
         if (image.getWidth() < size) return this;
         BufferedImage resize = Scalr.resize(image, Scalr.Mode.FIT_TO_WIDTH, size);
         image.flush();
         image = resize;
         return this;
     }
1205286
public void setDimension(int width, int height) {
        setWidth(String.valueOf(width));
        setHeight(String.valueOf(height));
        reload();
    }
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;
    }
793804
function resizeImage(img, max_width, max_height) {
    var sizes = this.getImageNewAspectSizes(img, max_width, max_height);
    var width = sizes.width;
    var height = sizes.height;
    var canvas = this.imageToCanvas(img, width, height);
    return canvas;
    //return this.getImageByCanvas(canvas);
  }
176435
public function resize($width, $height = null, $aspectRatio = Image::RESIZE_IGNORE): Image
	{
		$this->processor->resize($width, $height, $aspectRatio);

		return $this;
	}
384950
public void resize(int w, int h) {

        // using the new approach of Java 2D API
        BufferedImage buf = new BufferedImage(w, h, image.getType());
        Graphics2D g2d = (Graphics2D) buf.getGraphics();
        g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
        g2d.drawImage(image, 0, 0, w, h, null);
        g2d.dispose();
        image = buf;
        width = w;
        height = h;
        updateColorArray();
    }
549542
function resizeImage(ctx, imageData, width, height) {
  const {naturalWidth, naturalHeight} = imageData;
  if (width === naturalWidth && height === naturalHeight) {
    return imageData;
  }

  ctx.canvas.height = height;
  ctx.canvas.width = width;

  ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);

  // image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight
  ctx.drawImage(imageData, 0, 0, naturalWidth, naturalHeight, 0, 0, width, height);

  return ctx.canvas;
}
1259495
private function actionResize($width, $height)
    {
        $image = $this->getPhpThumb();
        $image->resize($width, $height);
    }
617481
@Override
    public void setSize(float width, float height)
    {
        if (view != null)
        {
            view.setSize(width, height);
        }
    }
313005
public function resize($width = null, $height = null)
    {
        $this->styleAttributes['width'] = $width . 'px';
        $this->styleAttributes['height'] = $height . 'px';

        return $this;
    }
1237175
public function resize( $width = null, $height = null )
    {
        // Get the source width and height
        $sourceWidth = imagesx( $this->image );
        $sourceHeight = imagesy( $this->image );

        // Check if any of the width and height is null, and set it to the $source size
        // $width = $width ?: $sourceWidth;
        // $height = $height ?: $sourceHeight;
        $sourceAspectRatio = $sourceWidth / $sourceHeight;

        if ( !$width && !$height ) {
            $width = $sourceWidth;
            $height = $sourceHeight;
        }
        else if ( ! $width ) {
            $width = $height * $sourceAspectRatio;
        }
        else {
            $height = $width / $sourceAspectRatio;
        }

        $maxCanvasWidth = $width;
        $maxCanvasHeight = $height;

        $thumbnailAspectRatio = $maxCanvasWidth / $maxCanvasHeight;

        // Create canvas for the new image
        $canvas = $this->createCanvas( $width, $height );

        // Do the resizing of the image
        imagecopyresampled($canvas, $this->image, 0, 0, 0, 0, $width, $height, $sourceWidth, $sourceHeight);

        // Replace the current image
        $this->replace( $canvas );

        // Return this for linking
        return $this;
    }
999454
public synchronized static Bitmap load(InputStream is, int width, int height) {
        BitmapFactory.Options opt = null;
        try {
            opt = new BitmapFactory.Options();
            if (width > 0 && height > 0) {
                if (is.markSupported()) {
                    is.mark(is.available());

                    opt.inJustDecodeBounds = true;
                    BitmapFactory.decodeStream(is, null, opt);
                    opt.inSampleSize = calculateInSampleSize(opt, width, height);
                    is.reset();
                }
            }

            opt.inJustDecodeBounds = false;
            opt.inPurgeable = true;
            opt.inInputShareable = true;

            return BitmapFactory.decodeStream(new FlushedInputStream(is), null, opt);
        } catch (Exception e) {
            Log.e(TAG, "", e);
            return null;
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                    System.out.print(e.toString());
                }
            }
            opt = null;
        }
    }
521990
public static int[] shrinkImage(BufferedImage srcImg, String dest, int width, int height) throws IOException {
		int w = srcImg.getWidth(null);
		int h = srcImg.getHeight(null);

		if (w <= width && h <= height) {
			width = w;
			height = h;
		} else {
			double r1 = (double) width / (double) w;
			double r2 = (double) height / (double) h;

			if (r1 > r2) {
				width = (int) (w * r2);
				height = (int) (h * r2);
			} else {
				width = (int) (w * r1);
				height = (int) (h * r1);
			}

			if (width <= 0)
				width = 1;
			if (height <= 0)
				height = 1;
		}

		int size = resizeImage(srcImg, dest, width, height);
		return new int[] { width, height, size };
	}