下面兩個文件:
<! - #包括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(,)