下面两个文件:
<! - #包括virtual =/intels/chunfeng/graphicdetect.asp->
<html>
<头>
<title>图像尺寸</title>
</head>
<身体bgcolor =#ffffff>
<%
Graphic = Images/intels.gif
hw = readimg(图形)
响应。写图形和尺寸:&hw(0)&x&hw(1)
&<br>
wresper.write <img src =/&graphic&
响应。关注高度=&hw(0)&
wress.write width =&hw(0)&>
%>
</body>
</html>
------------------------
GraphicDetect.asp
<%
昏暗的HW
功能ASCAT(S,N)
ASCAT = ASC(MID(S,N,1))
结束功能
功能hexat(s,n)
hexat = hex(ascat(s,n))
结束功能
函数ISJPG(fichero)
如果instr(ucase(fichero),.jpg)<> 0,则
ISJPG = true
别的
ISJPG = false
如果结束
结束功能
功能ISPNG(fichero)
如果instr(ucase(fichero),.png)<> 0,则
ispng = true
别的
ispng = false
如果结束
结束功能
功能ISGIF(fichero)
如果instr(ucase(fichero),.gif)<> 0,则
isgif = true
别的
isgif = false
如果结束
结束功能
功能ISBMP(Fichero)
如果instr(ucase(fichero),.bmp)<> 0,则
ISBMP = true
别的
ISBMP = false
如果结束
结束功能
函数ISWMF(fichero)
如果instr(ucase(fichero),.wmf)<> 0,则
iswmf = true
别的
iswmf = false
如果结束
结束功能
功能iswebimg(f)
如果ISGIF(F)或ISJPG(F)或ISPNG(F)或ISBMP(F)或ISWMF(F)
然后
iswebimg = true
别的
iswebimg = true
如果结束
结束功能
功能deadimg(fichero)
如果ISGIF(fichero),则
readimg = readgif(fichero)
别的
如果ISJPG(fichero),则
readimg = readjpg(fichero)
别的
如果ISPNG(fichero),则
readimg = readpng(fichero)
别的
如果是ISBMP(Fichero)
readimg = readpng(fichero)
别的
如果是ISWMF(Fichero)
readimg = readwmf(fichero)
别的
readimg = array(0,0)
如果结束
如果结束
如果结束
如果结束
如果结束
结束功能
函数读取JPG(fichero)
Dim FSO,TS,S,HW,NBYTES
hw = array(,)
set fso = createObject(scripting.filesystemobject)
设置ts = fso.opentextfile(server.mappath(/&fichero),1)
s =右(TS.Read(167),4)
hw(0)= hextodec(hexat(s,3)&hexat(s,4))
hw(1)= hextodec(hexat(s,1)&hexat(s,2))
ts.close
readjpg = hw
结束功能
函数读取(fichero)
Dim FSO,TS,S,HW,NBYTES
hw = array(,)