下面两个文件
<!-#inclua virtual =/Intels/chunfeng/graphicdetect.asp->
<html>
<head>
<Title> 图像尺寸 </title>
</head>
<corpo bgcolor =#ffffff>
<%
Graphic = Images/Intels.gif
Hw = readImg (gráfico)
Response.Write Graphic & Dimensions: & hw (0) & x & hw (1)
& <br>
Response.write <img src =/ & gráfico &
Response.Write Hight = & HW (0) &
Response.Write Width = & HW (0) &>
%>
</body>
</html>
------------------------
GraphicDetect.asp
<%
Dim HW
Função ascat (s, n)
ASCAT = ASC (MID (S, N, 1))
Função final
Função hexat (s, n)
Hexat = hex (ascat (s, n))
Função final
Função isjpg (fichero)
Se Instr (ucase (fichero), .jpg) <> 0 então
isjpg = true
Outro
isjpg = false
Final se
Função final
Função ispng (fichero)
Se Instr (ucase (fichero), .png) <> 0 então
ispng = true
Outro
ispng = false
Final se
Função final
Função ISGIF (Fichero)
Se Instr (ucase (fichero), .gif) <> 0 então
isgif = true
Outro
isgif = false
Final se
Função final
Função ISBMP (Fichero)
Se Instr (ucase (fichero), .bmp) <> 0 então
isbmp = true
Outro
isbmp = false
Final se
Função final
Função iswmf (fichero)
Se Instr (ucase (fichero), .wmf) <> 0 então
iswmf = true
Outro
iswmf = false
Final se
Função final
Função iswebimg (f)
Se ISGIF (F) ou ISJPG (F) ou ISPNG (F) ou ISBMP (F) ou ISWMF (F)
Então
iswebimg = true
Outro
iswebimg = true
Final se
Função final
Função ReadImg (Fichero)
Se ISGIF (Fichero) então
ReadImg = readgif (fichero)
Outro
Se ISJPG (Fichero) então
ReadImg = readjpg (fichero)
Outro
Se ISPNG (Fichero) então
ReadImg = readpng (fichero)
Outro
Se ISBMP (Fichero) então
ReadImg = readpng (fichero)
Outro
Se ISWMF (Fichero) então
ReadImg = readwmf (fichero)
Outro
ReadImg = Array (0,0)
Final se
Final se
Final se
Final se
Final se
Função final
Função ReadJpg (Fichero)
Dim FSO, TS, S, HW, Nbytes
Hw = matriz (,)
Set fso = createObject (script.filesystemObject)
Definir ts = fso.opentExtFile (Server.mappath (/ & fichero), 1)
s = à direita (ts.read (167), 4)
Hw (0) = hextodec (hexat (s, 3) e hexat (s, 4))
Hw (1) = hextodec (hexat (s, 1) e hexat (s, 2))
ts.close
Readjpg = hw
Função final
Função readpng (fichero)
Dim FSO, TS, S, HW, Nbytes
Hw = matriz (,)