<%
'##################################################################                                                                 
'★         web08.net - 威博购物系统                                              
'★  版权所有: web08.net                                                                                                       
'★  程序制作: 威博网络技术公司                                     
'★           email:web08net@hotmail.com                           
'★            Q Q :645095280,475980829
'★	       电话:021-55520018                                                                                                         
'★  相关网址: [产品介绍] http://www.021web.com.cn/gwxt.html
'★            [支持论坛] http://bbs.web08.net/                                                                                     
'★  主页地址: http://www.web08.net/  
'★		http://www.021web.com.cn/			                                                                 
'###################################################################
%>
<!--#include file=gpsclass.asp-->
<%
Function GetsPicSize(picaddr,w,h)
 //Dim curFile 
 //curFile=Server.mappath(Request.servervariables("PATH_INFO")) 
 //Dim curfilename,filename 
 //filename=left(curFile,instrrev(curFile,"\"))&cufilename 
 Dim GetPicSize
 Dim PicSuffixName 
 Set GetPicSize=new GPS 
 Set fs=Server.CreateObject(C_Web_FSO)
 if InStr(lcase(picaddr),"http://")>0 then
	GetsPicSize=w&"|"&h
	exit function	
 end if
 if trim(picaddr)="" or isnull(picaddr)=true then
	GetsPicSize="0|0"
	exit function	
 end if

 filename=server.mappath(picaddr)
 if fs.FileExists(filename)=false then
	GetsPicSize="0|0"
	exit function
 end if 
 PicSuffixName=lcase(fs.GetExtensionName(filename)) 

 Dim PD
 Dim PWidth,PHeight 
 Select Case lcase(PicSuffixName)
	Case "gif","bmp","jpg","png": 
		PD=GetPicSize.GetImageSize(filename) 
		PWidth=PD(1)
		PHeight=PD(2)
	Case "swf" 
		PD=GetPicSize.GetImageSize(filename) 
		PWidth=PD(1)
		PHeight=PD(2)
	Case Else 
 End Select 
 Set fs=Nothing 
 Set GetPicSize=Nothing 

 Dim PXWidth,PXHeight
 Dim Pp

 If PWidth=0 Or PWidth="" Then  
	PXWidth=0 
	PXHeight=0 
 Else 
	Pp=FormatNumber(PWidth/PHeight,2)
 End If

 If PWidth>=PHeight Then 
	If PWidth>=w Then 
		PXWidth=w
		PXHeight=FormatNumber(w/Pp,0) 
	Else 
		PXWidth=PWidth 
		PXHeight=PHeight 
	End If 
 Else 
	If PHeight>=cint(h) Then 
		PXHeight=h
		PXWidth=FormatNumber(h*Pp,0)
	Else 
		PXWidth=PWidth 
		PXHeight=PHeight 
	End If 
 End If
//response.write "<img src='"&picaddr&"' width='"&PXWidth&"' height='"&PXHeight&"'>"
 GetsPicSize=PXWidth&"|"&PXHeight
End Function
//call GetsPicSize("../images/proclasspic/06sdfsdf",120,120)
%> 

 
 

