Horde_Image_Base::addEffect PHP Method

addEffect() public method

Attempts to apply requested effect to this image.
public addEffect ( string $type, array $params )
$type string The type of effect to apply.
$params array Any parameters for the effect.
    public function addEffect($type, $params)
    {
        $class = str_replace('Horde_Image_', '', get_class($this));
        $params['logger'] = $this->_logger;
        $effect = Horde_Image_Effect::factory($type, $class, $params);
        $effect->setImageObject($this);
        $effect->apply();
    }

Usage Example

Beispiel #1
0
 /**
  * Add an effect to the effect stack
  *
  * @param string $type    The effect to add.
  * @param array  $params  The effect parameters.
  *
  * @throws Ansel_Exception
  */
 public function addEffect($type, $params = array())
 {
     try {
         $this->_image->addEffect($type, $params);
     } catch (Horde_Image_Exception $e) {
         Horde::log($e, 'ERR');
         throw new Ansel_Exception($e);
     }
 }