Horde_Image_Imagick::crop PHP Method

crop() public method

Crops the current image.
public crop ( integer $x1, integer $y1, integer $x2, integer $y2 )
$x1 integer x for the top left corner.
$y1 integer y for the top left corner.
$x2 integer x for the bottom right corner.
$y2 integer y for the bottom right corner.
    public function crop($x1, $y1, $x2, $y2)
    {
        try {
            $result = $this->_imagick->cropImage($x2 - $x1, $y2 - $y1, $x1, $y1);
            $this->_imagick->setImagePage(0, 0, 0, 0);
        } catch (ImagickException $e) {
            throw new Horde_Image_Exception($e);
        }
        $this->clearGeometry();
    }