protected function _do_crop($width, $height, $offset_x, $offset_y)
{
// Create the temporary image to copy to
$image = $this->_create($width, $height);
// Loads image if not yet loaded
$this->_load_image();
// Execute the crop
if (imagecopyresampled($image, $this->_image, 0, 0, $offset_x, $offset_y, $width, $height, $width, $height)) {
// Swap the new image for the old one
imagedestroy($this->_image);
$this->_image = $image;
// Reset the width and height
$this->width = imagesx($image);
$this->height = imagesy($image);
}
}