This is the base class that all implementations must extend. It contains the core variables and functionality common to all implementations, as well as the functions that allow plugins to augment those classes.
コード例 #1
0
ファイル: GdThumb.inc.php プロジェクト: zwq/unpei
 * @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
コード例 #2
0
ファイル: GdThumb.inc.php プロジェクト: s-kalaus/zkernel
 /**
  * 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
 }
コード例 #3
0
ファイル: EThumbnail.php プロジェクト: Canyian/EPhpThumb
 /**
  * Add watermark to Image
  *
  * @param $wm
  * @param $pos
  * @param $opacity
  * @param $offsetX
  * @param $offsetY
  *
  * @return EThumbnail
  */
 public function addWatermark($wm, $pos, $opacity, $offsetX, $offsetY)
 {
     $this->_thumbnail = $this->_thumbnail->addWatermark($wm->_thumbnail, $pos, $opacity, $offsetX, $offsetY);
     return $this;
 }