protected function exec($program, $params, $passthru = false)
	{
		//  Determine the path
		$this->im_path = realpath($this->config['imagemagick_dir'].$program);
		if ( ! $this->im_path)
		{
			$this->im_path = realpath($this->config['imagemagick_dir'].$program.'.exe');
		}
		if ( ! $this->im_path)
		{
			throw new \RuntimeException("imagemagick executables not found in ".$this->config['imagemagick_dir']);
		}

		$command = $this->im_path." ".$params;
		$this->debug("Running command: <code>$command</code>");
		$code = 0;
		$output = null;

		$passthru ? passthru($command) : exec($command, $output, $code);

		if ($code != 0)
		{
			throw new \FuelException("imagemagick failed to edit the image. Returned with $code.<br /><br />Command:\n <code>$command</code>");
		}

		return $output;
	}
protected function exec($program, $params, $passthru = false)
	{
		//  Determine the path
		$this->im_path = realpath($this->config['imagemagick_dir'].$program);
		if ( ! $this->im_path)
		{
			$this->im_path = realpath($this->config['imagemagick_dir'].$program.'.exe');
		}
		if ( ! $this->im_path)
		{
			throw new \RuntimeException("imagemagick executables not found in ".$this->config['imagemagick_dir']);
		}

		$command = $this->im_path." ".$params;
		$this->debug("Running command: <code>$command</code>");
		$code = 0;
		$output = null;

		$passthru ? passthru($command) : exec($command, $output, $code);

		if ($code != 0)
		{
			throw new \FuelException("imagemagick failed to edit the image. Returned with $code.<br /><br />Command:\n <code>$command</code>");
		}

		return $output;
	}
protected function exec ( $ program , $ params , $ passthru = false ) { //  Determine the path $ this -> im_path = realpath ( $ this -> config [ 'imagemagick_dir' ] . $ program ) ; if ( ! $ this -> im_path ) { $ this -> im_path = realpath ( $ this -> config [ 'imagemagick_dir' ] . $ program . '.exe' ) ; } if ( ! $ this -> im_path ) { throw new \ RuntimeException ( "imagemagick executables not found in " . $ this -> config [ 'imagemagick_dir' ] ) ; } $ command = $ this -> im_path . " " . $ params ; $ this -> debug ( "Running command: <code>$command</code>" ) ; $ code = 0 ; $ output = null ; $ passthru ? passthru ( $ command ) : exec ( $ command , $ output , $ code ) ; if ( $ code != 0 ) { throw new \ FuelException ( "imagemagick failed to edit the image. Returned with $code.<br /><br />Command:\n <code>$command</code>" ) ; } return $ output ; }
Executes the specified imagemagick executable and returns the output.

@param   string   $program   The name of the executable.
@param   string   $params    The parameters of the executable.
@param   boolean  $passthru  Returns the output if false or pass it to browser.
@return  mixed    Either returns the output or returns nothing.
Executes the specified imagemagick executable and returns the output .