Author: Chuck Hagenbuch (chuck@horde.org)
Author: Michael J. Rubinsky (mrubinsk@horde.org)
Author: Jan Schneider (jan@horde.org)
Inheritance: extends EmptyIterator
Example #1
0
File: Svg.php Project: horde/horde
 /**
  * Constructor.
  *
  * @see Horde_Image_Base::_construct
  */
 public function __construct($params, $context = array())
 {
     parent::__construct($params, $context);
     $this->_svg = new XML_SVG_Document(array('width' => $this->_width, 'height' => $this->_height));
     if ($this->_background != 'none') {
         $this->rectangle(0, 0, $this->_width, $this->_height, $this->_background, $this->_background);
     }
 }
Example #2
0
File: Null.php Project: horde/horde
 /**
  */
 public function __construct($params, $context = array())
 {
     parent::__construct($params, $context);
     if (!empty($params['filename'])) {
         $this->loadFile($params['filename']);
     } elseif (!empty($params['data'])) {
         $this->loadString($params['data']);
     }
 }
Example #3
0
 function Horde_Image_swf($params)
 {
     parent::Horde_Image($params);
     $this->_movie = new SWFMovie();
     $this->_movie->setDimension($this->_width, $this->_height);
     // FIXME: honor the 'background' parameter here.
     $this->_movie->setBackground(0xff, 0xff, 0xff);
     $this->_movie->setRate(30);
 }
Example #4
0
File: Swf.php Project: horde/horde
 /**
  * Constructor.
  *
  * @see Horde_Image_Base::_construct
  */
 public function __construct($params, $context = array())
 {
     parent::__construct($params, $context);
     $this->_movie = new SWFMovie();
     $this->_movie->setDimension($this->_width, $this->_height);
     $color = Horde_Image::getRGB($this->_background);
     $this->_movie->setBackground($color[0], $color[1], $color[2]);
     $this->_movie->setRate(30);
 }
Example #5
0
File: Im.php Project: horde/horde
 /**
  * Resets the image data.
  */
 public function reset()
 {
     parent::reset();
     $this->_operations = array();
     $this->_postSrcOperations = array();
     $this->clearGeometry();
 }
Example #6
0
 /**
  * Build an Ansel_Image from a given Horde_Image.
  * Used to wrap iterating the Horde_Image
  *
  * @param Horde_Image_Base $image  The Horde_Image
  *
  * @return Ansel_Image
  */
 protected function _buildImageObject(Horde_Image_Base $image)
 {
     $params = array('image_filename' => $this->filename, 'data' => $image->raw());
     $newImage = new Ansel_Image($params);
     return $newImage;
 }
Example #7
0
File: Png.php Project: horde/horde
 /**
  * Resets the image data to defaults.
  */
 public function reset()
 {
     parent::reset();
     $this->_img = array();
 }
Example #8
0
 public function reset()
 {
     parent::reset();
     $this->_imagick->clear();
     $this->_noMoreImages = false;
 }
Example #9
0
 /**
  * Load the image data from a file.
  *
  * @param string $filename  The full path and filename to the file to load
  *                          the image data from. The filename will also be
  *                          used for the image id.
  *
  * @return boolean
  * @throws Horde_Image_Exception
  */
 public function loadFile($filename)
 {
     $info = $this->call('getimagesize', array($filename));
     if (is_array($info)) {
         switch ($info[2]) {
             case 1:
                 if (function_exists('imagecreatefromgif')) {
                     $this->_im = $this->call('imagecreatefromgif', array($filename));
                 }
                 break;
             case 2:
                 $this->_im = $this->call('imagecreatefromjpeg', array($filename));
                 break;
             case 3:
                 $this->_im = $this->call('imagecreatefrompng', array($filename));
                 break;
             case 15:
                 if (function_exists('imagecreatefromgwbmp')) {
                     $this->_im = $this->call('imagecreatefromgwbmp', array($filename));
                 }
                 break;
             case 16:
                 $this->_im = $this->call('imagecreatefromxbm', array($filename));
                 break;
         }
     }
     if (is_resource($this->_im)) {
         return true;
     }
     $result = parent::loadFile($filename);
     $this->_im = $this->call('imageCreateFromString', array($this->_data));
 }
Example #10
0
 /**
  * Loads the image data from a file.
  *
  * @param string $filename  The full path and filename to the file to load
  *                          the image data from.
  */
 public function loadFile($filename)
 {
     $info = $this->call('getimagesize', array($filename));
     if (is_array($info)) {
         switch ($info[2]) {
             case IMAGETYPE_GIF:
                 if (function_exists('imagecreatefromgif')) {
                     $this->_im = $this->call('imagecreatefromgif', array($filename));
                 }
                 break;
             case IMAGETYPE_JPEG:
                 $this->_im = $this->call('imagecreatefromjpeg', array($filename));
                 break;
             case IMAGETYPE_PNG:
                 $this->_im = $this->call('imagecreatefrompng', array($filename));
                 break;
             case IMAGETYPE_WBMP:
                 if (function_exists('imagecreatefromgwbmp')) {
                     $this->_im = $this->call('imagecreatefromgwbmp', array($filename));
                 }
                 break;
             case IMAGETYPE_XBM:
                 $this->_im = $this->call('imagecreatefromxbm', array($filename));
                 break;
         }
     }
     if (is_resource($this->_im)) {
         return;
     }
     parent::loadFile($filename);
     $this->_im = $this->call('imageCreateFromString', array($this->_data));
 }
Example #11
0
 public function __construct($params)
 {
     parent::__construct($params);
     $this->_svg = new XML_SVG_Document(array('width' => $this->_width, 'height' => $this->_height));
 }