crop() public method

This is a wrapper function that chooses the proper cropping function based on the protocol specified
public crop ( ) : boolean
return boolean
示例#1
0
 /**
  * Execute cropping with current params
  * @param int $x - pixels from top
  * @param int $y - pixels from left
  * @param int $width - width from initial point in pixels
  * @param int $height - height from initial point in pixels
  * @throws \Exception
  * @return string - new file name
  */
 public function execute($x, $y, $width = null, $height = null)
 {
     if (!isset($this->params['source_image'])) {
         throw new \Exception('Cropping cannot be completed because source image is not set.');
     }
     $this->prepareParams($x, $y, $width, $height);
     $this->imageLib->initialize($this->params);
     //print_d($this->params);
     $this->imageLib->crop();
     return $this->params['new_image'];
 }