Use when you don't want to replace all pixels in the clipping area with
the border color i.e. you want to "frame" the existing image. Preserves
transparency etc.
/** * Draw the border. * * This draws the configured border to the provided image. Beware, * that every pixel inside the border clipping will be overwritten * with the background color. */ public function apply() { if ($this->_params['preserve']) { Horde_Image_Imagick::frameImage($this->_image->imagick, $this->_params['bordercolor'], $this->_params['borderwidth'], $this->_params['borderwidth']); } else { $this->_image->imagick->borderImage(new ImagickPixel($this->_params['bordercolor']), $this->_params['borderwidth'], $this->_params['borderwidth']); } return true; }
/** * Draws the border. * * This draws the configured border to the provided image. Beware, that * every pixel inside the border clipping will be overwritten with the * background color. */ public function apply() { if ($this->_params['preserve']) { Horde_Image_Imagick::frameImage($this->_image->imagick, $this->_params['bordercolor'], $this->_params['borderwidth'], $this->_params['borderwidth']); } else { try { $this->_image->imagick->borderImage(new ImagickPixel($this->_params['bordercolor']), $this->_params['borderwidth'], $this->_params['borderwidth']); } catch (ImagickPixelException $e) { throw new Horde_Image_Exception($e); } catch (ImagickException $e) { throw new Horde_Image_Exception($e); } } }