public function testCrop() { $imageCreator = new GdThumb(); $imageCreator->setSource($this->path . 'hlegius.jpg'); $return = $imageCreator->crop(50, 50, 100, 100); $this->assertInstanceOf('Deepzoom\\ImageAdapter\\ImageAdapterInterface', $return, 'crop() Cropping function that crops an image using $startX and $startY as the upper-left hand corner'); $this->assertAttributeInternalType('array', 'currentDimensions', $return, 'crop() Cropping function that crops an image using $startX and $startY as the upper-left hand corner'); $this->assertAttributeEquals(array('width' => 100, 'height' => 100), 'currentDimensions', $return, 'crop() Cropping function that crops an image using $startX and $startY as the upper-left hand corner'); $this->assertAttributeInternalType('resource', 'oldImage', $return, 'crop() Cropping function that crops an image using $startX and $startY as the upper-left hand corner'); }
/** * Cropping function that crops an image using $startX and $startY as the upper-left hand corner * * @param int $startX * @param int $startY * @param int $width * @param int $height */ public function crop($startX, $startY, $width, $height) { parent::crop($startX, $startY, $width, $height); return $this; }