亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产亚洲欧美日韩俺去了| 欧美一级电影网站| 国产高清亚洲一区| 精品一区二区久久| 韩国精品一区二区| 国产成人综合亚洲91猫咪| 久久精品国产亚洲高清剧情介绍| 视频一区免费在线观看| 视频精品一区二区| 肉丝袜脚交视频一区二区| 日韩激情一二三区| 久久99久久99| 成人久久久精品乱码一区二区三区| 丁香一区二区三区| 成人精品视频一区二区三区| 99久久久免费精品国产一区二区| 色综合天天综合网天天看片| 欧洲色大大久久| 欧美三级视频在线| 精品日韩成人av| 中文字幕乱码日本亚洲一区二区 | 老汉av免费一区二区三区| 久久爱另类一区二区小说| 国产一区亚洲一区| av网站一区二区三区| 欧洲亚洲精品在线| 精品国产污污免费网站入口 | 福利电影一区二区三区| 99久久免费精品高清特色大片| 在线观看日韩av先锋影音电影院| 在线播放亚洲一区| 久久久久国产精品免费免费搜索| 亚洲欧美另类图片小说| 日本午夜精品一区二区三区电影 | 欧美视频一区二区在线观看| 欧美日韩一本到| 国产午夜精品一区二区三区四区| 国产精品福利在线播放| 日本中文在线一区| 91一区二区三区在线观看| 欧美一级日韩免费不卡| 自拍偷拍国产亚洲| 久久国产精品99久久人人澡| 91在线看国产| 久久这里都是精品| 亚洲成人午夜影院| 粉嫩av一区二区三区在线播放| 欧美三级电影一区| 亚洲国产精品99久久久久久久久 | 蜜臀av国产精品久久久久| 不卡的电影网站| 精品美女在线观看| 亚洲一区欧美一区| 99久久国产综合精品女不卡 | 国产盗摄视频一区二区三区| 欧美精品一级二级三级| 国产精品福利av| 粉嫩一区二区三区在线看| 91精品国产入口在线| 一区二区激情视频| 99国产精品久久久久| 国产日产欧美一区二区三区| 偷偷要91色婷婷| 欧美色图12p| 亚洲一二三四久久| 99精品黄色片免费大全| 国产日韩在线不卡| 国产福利电影一区二区三区| 欧美不卡一区二区三区四区| 日韩高清在线观看| 777亚洲妇女| 日本大胆欧美人术艺术动态| 欧美日韩一级片在线观看| 亚洲福利视频一区二区| 91精品91久久久中77777| 亚洲日本中文字幕区| 99精品视频中文字幕| 中文字幕一区二区三区不卡| 99免费精品视频| 18成人在线视频| 在线观看亚洲a| 亚洲国产wwwccc36天堂| 欧美日免费三级在线| 午夜精品爽啪视频| 欧美一区二区成人| 精品一区二区三区免费播放| 欧美精品一区二区高清在线观看 | 99久久精品免费精品国产| 日韩一区欧美一区| 色综合一个色综合亚洲| 一区二区三区在线播放| 欧美亚洲自拍偷拍| 日韩高清不卡在线| 欧美变态tickling挠脚心| 久久成人久久爱| 国产精品毛片a∨一区二区三区 | 91成人网在线| 天堂va蜜桃一区二区三区漫画版| 日韩精品自拍偷拍| 成人avav在线| 亚洲图片有声小说| 精品国偷自产国产一区| 国产夫妻精品视频| 一区二区在线免费观看| 日韩一区二区视频在线观看| 国产成人无遮挡在线视频| 亚洲精品国久久99热| 91精品国产aⅴ一区二区| 国产精品一卡二卡| 亚洲精品久久嫩草网站秘色| 欧美一二三四在线| 91在线视频播放地址| 免费日本视频一区| 亚洲色图一区二区| 日韩美女视频在线| 91精彩视频在线| 国产精品18久久久久久vr| 日韩伦理电影网| 精品国产污污免费网站入口 | 69久久夜色精品国产69蝌蚪网| 国产精品一区久久久久| 午夜精品123| 国产精品视频你懂的| 欧美一区二区女人| 99精品1区2区| 国产精品99久久久久| 视频一区二区不卡| 亚洲精品水蜜桃| 国产欧美日韩视频一区二区| 在线成人av网站| 在线观看亚洲一区| 972aa.com艺术欧美| 国产一区二区三区在线观看精品| 亚洲chinese男男1069| 亚洲色图视频免费播放| 久久婷婷成人综合色| 日韩三级高清在线| 欧美视频日韩视频在线观看| 北条麻妃一区二区三区| 国产成人免费9x9x人网站视频| 日本不卡一区二区三区| 亚洲国产aⅴ天堂久久| 亚洲免费观看视频| 中文字幕一区二区在线观看| 欧美韩国一区二区| 欧美极品少妇xxxxⅹ高跟鞋| 久久一日本道色综合| 欧美tickling挠脚心丨vk| 91精品国产欧美日韩| 欧美一区二区三区四区久久| 欧美久久久影院| 制服丝袜一区二区三区| 91精品国产91久久综合桃花| 在线不卡欧美精品一区二区三区| 欧美怡红院视频| 在线观看欧美日本| 欧美三级日本三级少妇99| 欧美三级中文字幕| 欧美一区二区三区啪啪| 日韩欧美国产一二三区| 欧美精品一区二区三区四区| 久久先锋影音av| 国产精品网友自拍| 国产精品高潮呻吟久久| 亚洲黄色小视频| 亚洲bt欧美bt精品| 六月丁香婷婷久久| 国产激情一区二区三区| 不卡av免费在线观看| 色综合久久88色综合天天| 欧美在线观看一区| 欧美一区二区福利视频| 久久精品视频在线看| 成人欧美一区二区三区| 亚洲国产欧美在线| 黑人精品欧美一区二区蜜桃| 成人在线视频首页| 91福利在线播放| 日韩精品在线看片z| 国产精品热久久久久夜色精品三区| 中文字幕日韩av资源站| 亚洲大片精品永久免费| 精品在线观看免费| 91小视频在线| 欧美一级片在线看| 一区视频在线播放| 日韩av中文在线观看| 成人亚洲精品久久久久软件| 欧美日韩精品一区二区三区 | 99视频精品免费视频| 9191成人精品久久| 日本一区二区三级电影在线观看| 亚洲一级二级三级在线免费观看| 久久99精品一区二区三区| 91免费看视频| 久久久99久久精品欧美| 亚洲福利视频导航| 成人av在线播放网址| 日韩小视频在线观看专区| 成人欧美一区二区三区1314|