亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? class.image.php5.php

?? 國內開發的javascript框架應用。龍博javascript。
?? PHP
?? 第 1 頁 / 共 2 頁
字號:
<?php
/**************************************************************************
 * CLASS clsImage [PHP5] v1.0 09.12.2004      
 *
 * http://www.zutz.nl/phpclasses
 *
 * this is an image manipulation class for PHP5 with the Zend engine
 * based on the GD Library. supported imagetypes: [ jpg | gif | png ]
 * 
 * LICENSE
 * Public domain
 *
 * MODERATOR
 * Ronald Z鰐sch - ZUTZ Automatisering
 **************************************************************************/
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
    include_once ("class.image.config.win.php");
else 
    include_once ("class.image.config.unix.php");
include ("class.image.interface.php");

class clsImage implements interfaceImage {
/* constants */
  const IMAGEBASEURL = IMAGEBASEURL;
  const IMAGEBASEPATH = IMAGEBASEPATH;
  const IMAGEFONTDIR = IMAGEFONTDIR;
	const IMAGEINTERLACE = IMAGEINTERLACE;
	const IMAGEJPEGQUALITY = IMAGEJPEGQUALITY;
	const IMAGEDEBUG = IMAGEDEBUG;
	
/* properties */
  private $ImageStream;
  private $aProperties;
	protected $sFileLocation;
  protected $sImageURL;
  protected $IMAGEBASEURL;
  protected $IMAGEBASEPATH;
		
	public $interlace;
	public $jpegquality;	

/* default methods */
  function __construct($path="", $url="") {
	/* constructor */
	  $this->aProperties = array();
		$this->jpegquality = clsImage::IMAGEJPEGQUALITY;
		
		/* set interlace boolean */
		if (clsImage::IMAGEINTERLACE != 0) {
		  $this->interlace = true;
		}
		else {
		  $this->interlace = false;		
		}
		$this->IMAGEBASEURL = ($url=="")?clsImage::IMAGEBASEURL:$url;
    $this->IMAGEBASEPATH = ($path=="")?clsImage::IMAGEBASEPATH:$path;
	}
	
  function __destruct() {
	/* destructor */
    unset($this->ImageStream);
    unset($this->aProperties);
	}
	
  public function __get($sPropertyName) {
	/* get properties */
		if (isset($this->aProperties[$sPropertyName])) {
		  $sPropertyValue = $this->aProperties[$sPropertyName];
		}
		else {	
      $sPropertyValue = NULL;
		}
		
    return($sPropertyValue);
  }
	
  private function __set($sPropertyName, $sPropertyValue) {
	/* set properties */
		if (!isset($this->aProperties)) {
		  $this->aProperties = array();
		}

    $this->aProperties[$sPropertyName] = $sPropertyValue;			
  }		
	
/* private methods */
	private function printError($sMessage, $sMethod = __METHOD__, $sLine = __LINE__) {
	/* echo errormessage to client and terminate script run */
	  if(clsImage::IMAGEDEBUG == 1) {
		  echo $sMethod . "(" . $sLine . ") " . $sMessage;
    }

	  if(clsImage::IMAGEDEBUG == 2) {
			header("Location: class.image.debug.code.php?line={$sLine}#{$sLine}");
    }

		exit;	
	}
	
  private function loadImage() {
	/* load a image from file */
	  switch($this->type) {
		  case 1: 
			  $this->ImageStream = @imagecreatefromgif($this->sFileLocation);
			  break;
			case 2:
			  $this->ImageStream = @imagecreatefromjpeg($this->sFileLocation);			
			  break;
			case 3: 
			  $this->ImageStream = @imagecreatefrompng($this->sFileLocation);			
			  break;
			default: 
			  $this->printError('invalid imagetype',__METHOD__,__LINE__); 
		}	
		
    if (!$this->ImageStream) {
		  $this->printError('image not loaded',__METHOD__,__LINE__); 
    }		
	}
	
  private function saveImage() {
	/* store a memoryimage to file */
    if (!$this->ImageStream) {
		  $this->printError('image not loaded',__METHOD__,__LINE__); 
    }

    /*ensure the dir*/
	$i = explode(DIRECTORY_SEPARATOR, $this->sFileLocation);
	$path = array_shift($i);
	for ($j=0,$k=count($i);$j<$k-1;$j++) {
		$path .= DIRECTORY_SEPARATOR.$i[$j];
		if (!is_dir($path)) {
			if (!@mkdir($path)){
			    $this->printError("Can\'t make dir --$path",__METHOD__,__LINE__); 
			}
		}
	}


	  switch($this->type) {
		  case 1: 
			  /* store a interlaced gif image */
			  if ($this->interlace === true) {
   			  imageinterlace($this->ImageStream, 1);
				}
				
			  imagegif($this->ImageStream,$this->sFileLocation);
			  break;
			case 2:
			  /* store a progressive jpeg image (with default quality value)*/
			  if ($this->interlace === true) {
   			  imageinterlace($this->ImageStream, 1);
				}
				
			  imagejpeg($this->ImageStream,$this->sFileLocation,$this->jpegquality);							
			  break;
			case 3: 
			  /* store a png image */
			  imagepng($this->ImageStream,$this->sFileLocation);			
			  break;
			default: 
			  $this->printError('invalid imagetype',__METHOD__,__LINE__); 
				
			if (!file_exists($this->sFileLocation)) {
				$this->printError('file not stored',__METHOD__,__LINE__); 		
			}				
		}			
	}	
	
  private function showImage() {
	/* show a memoryimage to screen */
    if (!$this->ImageStream) {
		  $this->printError('image not loaded',__METHOD__,__LINE__); 
    }
		
	  switch($this->type) {
		  case 1: 
			  imagegif($this->ImageStream);
			  break;
			case 2:
			  imagejpeg($this->ImageStream);			
			  break;
			case 3: 
			  imagepng($this->ImageStream);			
			  break;
			default: 
			  $this->printError('invalid imagetype',__METHOD__,__LINE__); 				
		}			
	}	
	
  private function setFilenameExtension() {
	/* set the imahe type and mimetype */
	  $sOldFilenameExtension = substr($this->filename,strlen($this->filename) - 4, 4);
		if (($sOldFilenameExtension != '.gif') &&
		    ($sOldFilenameExtension != '.jpg') &&
			  ($sOldFilenameExtension != '.png')) {
			$this->printError('invalid filename extension',__METHOD__,__LINE__);
		}
		
	  switch($this->type) {
		  case 1: 
			  $this->filename = substr($this->filename,0,strlen($this->filename) - 4) . '.gif';
			  break;
			case 2:
			  $this->filename = substr($this->filename,0,strlen($this->filename) - 4) . '.jpg';			
			  break;
			case 3: 
			  $this->filename = substr($this->filename,0,strlen($this->filename) - 4) . '.png';			
			  break;
			default: 
			  $this->printError('invalid imagetype',__METHOD__,__LINE__); 
		}			
	} 

  private function setImageType($iType) {
	/* set the imahe type and mimetype */
	  switch($iType) {
		  case 1: 
			  $this->type = $iType;
			  $this->mimetype = 'image/gif';
				$this->setFilenameExtension();
			  break;
			case 2:
			  $this->type = $iType;
			  $this->mimetype = 'image/jpeg';
				$this->setFilenameExtension();							
			  break;
			case 3: 
			  $this->type = $iType;
			  $this->mimetype = 'image/png';
				$this->setFilenameExtension();							
			  break;
			default: 
			  $this->printError('invalid imagetype',__METHOD__,__LINE__); 
		}			
	}

	private function setLocations($sFileName) {
  /* set the photo url */
	  $this->filename = $sFileName;
    $this->sFileLocation = $this->IMAGEBASEPATH . DIRECTORY_SEPARATOR . $this->filename;
    $this->sImageURL = $this->IMAGEBASEURL . '/' . $this->filename;		
	}
	
	public function setPathAndURL($path="",$url=""){
    $this->IMAGEBASEPATH = ($path=="")?$this->IMAGEBASEPATH:$path;
    $this->IMAGEBASEURL = ($url=="")?$this->IMAGEBASEURL:$url;
  } 
	
	private function initializeImageProperties() {
	/* get imagesize from file and set imagesize array */
	  list($this->width, $this->height, $iType, $this->htmlattributes) = getimagesize($this->sFileLocation);

		if (($this->width < 1) || ($this->height < 1)) {
		  $this->printError('invalid imagesize',__METHOD__,__LINE__); 
		}			 
		
		$this->setImageOrientation();
		$this->setImageType($iType);
	}

	private function setImageOrientation() {
	/* get image-orientation based on imagesize
	   options: [ portrait | landscape | square ] */
		 
		if ($this->width < $this->height) {
		  $this->orientation = 'portrait';
		}
		
		if ($this->width > $this->height) {
		  $this->orientation = 'landscape';
		}
		
		if ($this->width == $this->height) {
		  $this->orientation = 'square';
		}							
	}	
		
/* public methods */
	public function loadfile($sFileName) {
	/* load an image from file into memory */
	  $this->setLocations($sFileName);
		
		if (file_exists($this->sFileLocation)) { 		
		  $this->initializeImageProperties();
      $this->loadImage();
		}
		else {
		  $this->printError('file not found',__METHOD__,__LINE__); 
		}

	}
	
	public function savefile($sFileName = NULL) {
  /* store memory image to file */
	  if ((isset($sFileName)) && ($sFileName != '')) {
      $this->setLocations($sFileName);
		}	
	 
    $this->saveImage();
	}	
	
	public function preview() {
  /* print memory image to screen */
		header("Content-type: {$this->mimetype}");
    $this->showImage();	
	}	

	public function showhtml($sAltText = NULL, $sClassName = NULL) {
  /* print image as htmltag */
		if (file_exists($this->sFileLocation)) {
		  /* set html alt attribute */
		  if ((isset($sAltText)) && ($sAltText != '')) {
			  $htmlAlt = " alt=\"".$sAltText."\"";
			}
			else {
			  $htmlAlt = "";
			}
			
		  /* set html class attribute */
		  if ((isset($sClassName)) && ($sClassName != '')) {
			  $htmlClass = " class=\"".$sClassName."\"";
			}
			else {
			  $htmlClass = " border=\"0\"";
			}			
			
	    $sHTMLOutput = '<img src="'.$this->sImageURL.'"'.$htmlClass.' width="'.$this->width.'" height="'.$this->height.'"'.$htmlAlt.'>';	
			print $sHTMLOutput;
		}
		else {
		  $this->printError('file not found',__METHOD__,__LINE__); 
		}	
	}
	
	public function resize($iNewWidth, $iNewHeight) {
	/* resize the memoryimage do not keep ratio */
    if (!$this->ImageStream) {
		  $this->printError('image not loaded',__METHOD__,__LINE__); 
    }    
			
		if(function_exists("imagecopyresampled")){
			$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);
			imagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);
		}
		else{
			$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);
				imagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);
		}		
		
		$this->ImageStream = $ResizedImageStream;
		$this->width = $iNewWidth;
		$this->height = $iNewHeight;
		$this->setImageOrientation();		
	}	
	
	public function cut($x, $y, $iNewWidth=-1, $iNewHeight=-1) {
	/* resize the memoryimage do not keep ratio */
    if (!$this->ImageStream) {
		  $this->printError('image not loaded',__METHOD__,__LINE__); 
    }    
		if($x>$this->width||$y>$this->height){
      return;
    }
    
		if($iNewWidth<0){
      $iNewWidth = $this->width - $x;
    }else{
      $iNewWidth = max(0,min($this->width - $x,$iNewWidth));
    }
		if($iNewHeight<0){
      $iNewHeight = $this->height - $y;
    }else{
      $iNewHeight = max(0,min($this->height - $y,$iNewHeight));
    }
		
		if(function_exists("imagecopyresampled")){
			$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);
			imagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, $x, $y, $iNewWidth, $iNewHeight, $iNewWidth, $iNewHeight);
		}
		else{
			$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);
			imagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, $x, $y, $iNewWidth, $iNewHeight, $iNewWidth, $iNewHeight);
		}		
		
		$this->ImageStream = $ResizedImageStream;
		$this->width = $iNewWidth;
		$this->height = $iNewHeight;
		$this->setImageOrientation();		
	}	
	
	public function resizetowidth($iNewWidth) {
  /* resize image to given width (keep ratio) */
		$iNewHeight = ($iNewWidth / $this->width) * $this->height;
		$this->resize($iNewWidth,$iNewHeight); 		
	}	
	
	public function resizetoheight($iNewHeight) {
  /* resize image to given height (keep ratio) */
		$iNewWidth = ($iNewHeight / $this->height) * $this->width;
		$this->resize($iNewWidth,$iNewHeight); 		
	}	
	
	public function resizetopercentage($iPercentage) {
  /* resize image to given percentage (keep ratio) */
		$iPercentageMultiplier = $iPercentage / 100;
		$iNewWidth = $this->width * $iPercentageMultiplier;
		$iNewHeight = $this->height * $iPercentageMultiplier;		
		
    $this->resize($iNewWidth,$iNewHeight);		
	}	
	

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩极品在线观看一区| 精品成人在线观看| 精品久久久久久久久久久久包黑料| 久久久三级国产网站| 中文av一区特黄| 日韩**一区毛片| 91啪九色porn原创视频在线观看| 午夜a成v人精品| 成人午夜私人影院| wwww国产精品欧美| 偷拍亚洲欧洲综合| 成人h版在线观看| 日韩欧美精品三级| 偷拍日韩校园综合在线| 色国产综合视频| 国产精品另类一区| 国产福利视频一区二区三区| 91.麻豆视频| 亚洲成人一区二区在线观看| 欧美精品黑人性xxxx| 亚洲一级不卡视频| 91网站最新网址| 国产精品国产三级国产aⅴ原创 | 中文一区二区完整视频在线观看| 91精品视频网| 亚洲国产精品人人做人人爽| 一本久久a久久免费精品不卡| 成人丝袜视频网| 精品国产一区二区精华| 日韩电影免费在线| 7777精品伊人久久久大香线蕉最新版| 欧美区视频在线观看| 亚洲大片在线观看| 欧美日韩黄视频| 午夜不卡在线视频| 欧美一区二区三区四区久久| 亚洲一区在线视频观看| 色偷偷久久人人79超碰人人澡| 欧美私人免费视频| 亚洲视频图片小说| 91在线视频18| 一区二区三区欧美| 欧美精品v国产精品v日韩精品| 精品久久国产老人久久综合| 免费观看91视频大全| 精品日本一线二线三线不卡| 激情综合色播激情啊| 久久久不卡网国产精品二区| 激情综合网激情| 国产精品久久久久久久久晋中 | 久久久影院官网| 成人国产精品免费观看动漫| 国产精品每日更新| av电影在线观看一区| 夜色激情一区二区| 日韩精品一区国产麻豆| 国产一区91精品张津瑜| 亚洲三级免费电影| 91精品国产日韩91久久久久久| 国产精品久久福利| 欧美日韩国产一级二级| 九色|91porny| 亚洲视频一二三| 制服丝袜亚洲播放| 国产综合久久久久影院| 亚洲婷婷综合色高清在线| 精品视频一区二区不卡| 美女视频一区二区| 亚洲欧美另类在线| 日韩欧美成人激情| 99精品黄色片免费大全| 男人的天堂久久精品| 1024亚洲合集| 欧美sm极限捆绑bd| 日本电影欧美片| 国产麻豆一精品一av一免费| 亚洲综合在线五月| 久久香蕉国产线看观看99| 色综合久久综合| 国产乱人伦偷精品视频免下载| 欧美日韩日日摸| 国产精品一区二区久久精品爱涩 | 成人综合在线观看| 偷拍自拍另类欧美| 亚洲日本护士毛茸茸| 日韩欧美精品在线视频| 在线一区二区三区四区| 国产乱码精品一区二区三区忘忧草| 日韩一区二区三区电影| 91无套直看片红桃| 国产精品91一区二区| 日本不卡视频在线| 一区二区三区精密机械公司| 久久久久亚洲综合| 日韩一区二区影院| 欧美人与性动xxxx| 色88888久久久久久影院按摩| 国产精品免费观看视频| 91精品欧美福利在线观看| 成人国产精品免费| 国产91在线|亚洲| 裸体歌舞表演一区二区| 天天影视涩香欲综合网 | 日韩黄色免费网站| 国产精品电影一区二区三区| 久久在线观看免费| 欧美sm极限捆绑bd| 日韩免费在线观看| 日韩一区二区在线看片| 91精品国产综合久久久蜜臀图片 | 欧美成人一级视频| 91精品在线免费观看| 欧美日韩一区二区在线观看 | 7777精品伊人久久久大香线蕉超级流畅 | 午夜电影久久久| 亚洲激情欧美激情| 亚洲一区二区av电影| 亚洲夂夂婷婷色拍ww47| 亚洲一区二区三区中文字幕| 亚洲另类色综合网站| 亚洲毛片av在线| 一区二区三区四区在线免费观看| 色婷婷亚洲一区二区三区| 不卡的av网站| 一本久久精品一区二区| 欧美日韩一区精品| 日韩三级高清在线| 久久久久久久一区| 国产日产精品1区| 日韩一区中文字幕| 亚洲国产日韩a在线播放| 午夜精品一区二区三区三上悠亚| 久久亚洲精精品中文字幕早川悠里| 福利电影一区二区三区| 国产成人精品网址| 91蜜桃在线免费视频| 在线观看不卡视频| 日韩三级精品电影久久久| 久久免费偷拍视频| 综合久久久久久久| 亚洲成人精品在线观看| 国产资源精品在线观看| 成人免费av资源| 欧美午夜理伦三级在线观看| 欧美影院一区二区| 日韩精品一区二| 国产精品家庭影院| 午夜视频久久久久久| 国产盗摄精品一区二区三区在线| 亚洲成av人影院| 精东粉嫩av免费一区二区三区| 亚洲韩国一区二区三区| 激情久久久久久久久久久久久久久久 | 亚洲欧美激情小说另类| 日韩在线一二三区| 成人亚洲精品久久久久软件| 欧美网站大全在线观看| 久久夜色精品一区| 自拍偷拍欧美精品| 国产一区二区在线免费观看| 色综合久久综合网97色综合| 2019国产精品| 亚洲午夜精品一区二区三区他趣| 国产精品初高中害羞小美女文| 日韩欧美一二三四区| 中文字幕的久久| 日产国产高清一区二区三区| 99精品欧美一区二区三区小说| 国产a区久久久| 制服丝袜亚洲播放| 亚洲综合精品自拍| 成人免费视频国产在线观看| 日韩免费一区二区三区在线播放| 色狠狠一区二区| 国产精品嫩草久久久久| 激情综合网最新| 欧美手机在线视频| 亚洲免费电影在线| 波多野结衣的一区二区三区| 久久综合色天天久久综合图片| 国产欧美精品一区aⅴ影院| 日韩激情一二三区| 欧美影院一区二区三区| 欧美激情中文不卡| 国产成人亚洲综合a∨猫咪| 日韩视频在线永久播放| 午夜精品在线视频一区| 欧美综合天天夜夜久久| 中文字幕在线观看一区| 成人激情综合网站| 国产日韩欧美在线一区| 国产一区二区精品在线观看| 欧美zozo另类异族| 国内精品久久久久影院色| 日韩一区二区三区免费看| 奇米精品一区二区三区四区| 69堂精品视频| 日韩黄色一级片| 日韩一区二区三区在线| 国产欧美日韩另类一区|