__construct() public method

Class constructor
public __construct ( $fileName, $isDataStream = false ) : ThumbBase
return ThumbBase
Exemplo n.º 1
0
 * @filesource
 */
/**
 * GdThumb Class Definition
 * 
 * This is the GD Implementation of the PHP Thumb library.
 * 
 * @package PhpThumb
 * @subpackage Core
 */
class GdThumb extends ThumbBase
{
    /**
	 * The prior image (before manipulation)
	 * 
	 * @var resource
	 */
    protected $oldImage;
    /**
	 * The working image (used during manipulation)
	 * 
	 * @var resource
	 */
    protected $workingImage;
    /**
	 * The current dimensions of the image
Exemplo n.º 2
0
 /**
  * Class Constructor
  *
  * @return GdThumb
  * @param string $fileName
  */
 public function __construct($fileName, $options = array())
 {
     parent::__construct($fileName);
     $this->determineFormat();
     $this->verifyFormatCompatiblity();
     switch ($this->format) {
         case 'GIF':
             $this->oldImage = imagecreatefromgif($this->fileName);
             break;
         case 'JPG':
             $this->oldImage = imagecreatefromjpeg($this->fileName);
             break;
         case 'PNG':
             $this->oldImage = imagecreatefrompng($this->fileName);
             break;
     }
     $size = getimagesize($this->fileName);
     $this->currentDimensions = array('width' => $size[0], 'height' => $size[1]);
     $this->setOptions($options);
     // TODO: Port gatherImageMeta to a separate function that can be called to extract exif data
 }