You are here

function imageapi_image_resize in ImageAPI 5

Same name and namespace in other branches
  1. 6 imageapi.module \imageapi_image_resize()

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

Parameters

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

$width: The target width, in pixels.

$height: The target height, in pixels.

Return value

TRUE or FALSE, based on success.

2 calls to imageapi_image_resize()
imageapi_image_scale in ./imageapi.module
Scales an image to the given width and height while maintaining aspect ratio.
imageapi_image_scale_and_crop in ./imageapi.module
Scales an image to the exact width and height given.

File

./imageapi.module, line 255
An ImageAPI supporting mulitple image toolkits. Image toolkits are implemented as modules. Images are objects, but have no methods

Code

function imageapi_image_resize(&$image, $width, $height) {
  $width = (int) round($width);
  $height = (int) round($height);
  return imageapi_toolkit_invoke('resize', $image, array(
    $width,
    $height,
  ));
}