public function processImage($image, $output = null, $imagineOptions = [], $operations = []) {
		if (is_string($image)) {
			$this->_processor->open($image);
			$image = $this->_processor->image();
		}
		if (!$image instanceof AbstractImage) {
			throw new \InvalidArgumentException('An instance of `\Imagine\Image\AbstractImage` is required, you passed `%s`!', get_class($image));
		}

		$event = $this->_table->dispatchEvent('ImagineBehavior.beforeApplyOperations', compact('image', 'operations'));
		if ($event->isStopped()) {
			return $event->result;
		}

		$data = $event->data();
		$this->_applyOperations(
			$data['operations'],
			$data['image']
		);

		$event = $this->_table->dispatchEvent('ImagineBehavior.afterApplyOperations', $data);
		if ($event->isStopped()) {
			return $event->result;
		}

		if ($output === null) {
			return $image;
		}

		return $this->_processor->save($output, $imagineOptions);
	}
public function processImage($image, $output = null, $imagineOptions = [], $operations = []) {
		if (is_string($image)) {
			$this->_processor->open($image);
			$image = $this->_processor->image();
		}
		if (!$image instanceof AbstractImage) {
			throw new \InvalidArgumentException('An instance of `\Imagine\Image\AbstractImage` is required, you passed `%s`!', get_class($image));
		}

		$event = $this->_table->dispatchEvent('ImagineBehavior.beforeApplyOperations', compact('image', 'operations'));
		if ($event->isStopped()) {
			return $event->result;
		}

		$data = $event->data();
		$this->_applyOperations(
			$data['operations'],
			$data['image']
		);

		$event = $this->_table->dispatchEvent('ImagineBehavior.afterApplyOperations', $data);
		if ($event->isStopped()) {
			return $event->result;
		}

		if ($output === null) {
			return $image;
		}

		return $this->_processor->save($output, $imagineOptions);
	}
public function processImage ( $ image , $ output = null , $ imagineOptions = [ ] , $ operations = [ ] ) { if ( is_string ( $ image ) ) { $ this -> _processor -> open ( $ image ) ; $ image = $ this -> _processor -> image ( ) ; } if ( ! $ image instanceof AbstractImage ) { throw new \ InvalidArgumentException ( 'An instance of `\Imagine\Image\AbstractImage` is required, you passed `%s`!' , get_class ( $ image ) ) ; } $ event = $ this -> _table -> dispatchEvent ( 'ImagineBehavior.beforeApplyOperations' , compact ( 'image' , 'operations' ) ) ; if ( $ event -> isStopped ( ) ) { return $ event -> result ; } $ data = $ event -> data ( ) ; $ this -> _applyOperations ( $ data [ 'operations' ] , $ data [ 'image' ] ) ; $ event = $ this -> _table -> dispatchEvent ( 'ImagineBehavior.afterApplyOperations' , $ data ) ; if ( $ event -> isStopped ( ) ) { return $ event -> result ; } if ( $ output === null ) { return $ image ; } return $ this -> _processor -> save ( $ output , $ imagineOptions ) ; }
Loads an image and applies operations on it.

Caching and taking care of the file storage is NOT the purpose of this method!

@param string|\Imagine\Image\AbstractImage $ImageObject
@param string $output
@param array $imagineOptions
@param array $operations
@throws \InvalidArgumentException
@return bool
Loads an image and applies operations on it .