resize image to given width and height
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;
}
416258
def resize_image(image_str_tensor):
  """"""

  image = decode_and_resize(image_str_tensor)
  image = tf.image.encode_jpeg(image, quality=100)
  return image
372201
def resize_by_area(img, size):
  """"""
  return tf.to_int64(
      tf.image.resize_images(img, [size, size], tf.image.ResizeMethod.AREA))
676373
def _thumbnail_resize(self, image, thumb_size, crop=None, bg=None):
        """"""

        if crop == 'fit':
            img = ImageOps.fit(image, thumb_size, Image.ANTIALIAS)
        else:
            img = image.copy()
            img.thumbnail(thumb_size, Image.ANTIALIAS)

        if bg:
            img = self._bg_square(img, bg)

        return img
1262546
def _scale(self, image, width, height):
        
        image['options']['scale'] = '%sx%s!' % (width, height)
        image['size'] = (width, height)  # update image size
        return image
590467
def resize(self, newWidth = 0, newHeight = 0):
        
        self.height = newHeight
        self.width = newWidth
36769
def image2array(image):
    
    nx, ny = image.shape  # find the size of the array
    imgh = np.reshape(image, nx*ny)  # change the shape to be 1d
    return imgh
637709
def resize!
      begin
        image = MiniMagick::Image.open(@file.path)
        image.resize("#{@width}x#{@height}")
      rescue
        # Pass on any error
      else
        image.write(@file.path) rescue nil
      end
    end
1163317
public static void reshapeDown(ImageBase image, int inputWidth, int inputHeight, int squareWidth) {
		int w = downSampleSize(inputWidth,squareWidth);
		int h = downSampleSize(inputHeight,squareWidth);

		image.reshape(w,h);
	}
618992
def upscale(inputs, f, method=tf.image.ResizeMethod.NEAREST_NEIGHBOR):
  """"""
  height, width = shape_list(inputs)[1:3]  # pylint: disable=unbalanced-tuple-unpacking
  return tf.image.resize_images(inputs, (height * f, width * f), method)
349300
function (src, x, y, width, height) {
		var obj = this.createElement('img')
			.attr({ src: src });

		if (arguments.length > 1) {
			obj.css({
				left: x,
				top: y,
				width: width,
				height: height
			});
		}
		return obj;
	}
1346314
def set_desired_size(self, width, height):
        """"""
        self._desired_size = (width, height)
        if not self._imgwin_set:
            self.set_window_size(width, height)
431085
def resize(self, height, width, **kwargs):
        
        self.client.resize(self.container, height=height, width=width)
89382
function resizeImage(options, callback) {
  var size = options.size.width + 'x' + options.size.height;
  if (!options.size.maintainratio) {
    size += '\\!';
  }
  var command = [
    options.convert,
    options.org,
    '-adaptive-resize',
    options.size.width + 'x' + options.size.height,
    options.path
    ].join(' ');

  /* Create folder if we have to. */
  var dest = lib.path.join(options.dest, options.size.name);
  if (!lib.fs.existsSync(dest)) {
    lib.fs.mkdirSync(dest);
  }

  /* Create resize */
  lib.exec(command, function (err, stdout, stderr) {
    callback(err, options.path);
  });
}
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);
  }
648724
def resize(self, height, width):
        
        return self.client.api.resize(self.id, height, width)
1265497
def getDimensionForImage(filename, maxsize):
    """"""
    try:
        from PIL import Image
    except ImportError:
        return None
    img = Image.open(filename)
    width, height = img.size
    if width > maxsize[0] or height > maxsize[1]:
        img.thumbnail(maxsize)
        out.info("Downscaled display size from %s to %s" % ((width, height), img.size))
    return img.size