1.20.x image.inc image_resize(stdClass $image, $width, $height)

Resizes an image to the given dimensions (ignoring aspect ratio).

Parameters

$image: An image object returned by image_load().

$width: The target width, in pixels.

$height: The target height, in pixels.

Return value

TRUE on success, FALSE on failure.:

See also

image_load()

image_gd_resize()

Related topics

File

includes/image.inc, line 278
API for manipulating images.

Code

function image_resize(stdClass $image, $width, $height) {
  $width = (int) round($width);
  $height = (int) round($height);

  return image_toolkit_invoke('resize', $image, array($width, $height));
}