You are here

function image_crop in Drupal 6

Same name and namespace in other branches
  1. 4 includes/image.inc \image_crop()
  2. 5 includes/image.inc \image_crop()
  3. 7 includes/image.inc \image_crop()

Crop an image to the rectangle specified by the given rectangle.

Parameters

$source: The file path of the source image.

$destination: The file path of the destination image.

$x: The top left co-ordinate, in pixels, of the crop area (x axis value).

$y: The top left co-ordinate, in pixels, of the crop area (y axis value).

$width: The target width, in pixels.

$height: The target height, in pixels.

Return value

TRUE or FALSE, based on success.

Related topics

File

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

Code

function image_crop($source, $destination, $x, $y, $width, $height) {
  return image_toolkit_invoke('crop', array(
    $source,
    $destination,
    $x,
    $y,
    $width,
    $height,
  ));
}