image_crop

Definition

image_crop($source, $destination, $x, $y, $width, $height)
includes/image.inc, line 264

Description

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

Namesort iconDescription
Image toolkitsDrupal's image toolkits provide an abstraction layer for common image file manipulations like scaling, cropping, and rotating. The abstraction frees module authors from the need to support multiple image libraries, and it allows site...

Code

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

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.