image_crop

Versions
4.6 – 6
image_crop($source, $destination, $x, $y, $width, $height)
7
image_crop(stdClass $image, $x, $y, $width, $height)

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

Parameters

$source The filepath of the source image

$destination The file path of the destination image

$x The top left co-ordinate of the crop area (x axis value)

$y The top left co-ordinate of the crop area (y axis value)

$width The target width

$height The target height

Code

includes/image.inc, line 165

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

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.