ASPimage supportere ikke GIF billeder ifgølge manualen:
http://www.serverobjects.com/comp/Aspimage.htmQ: Why doesn't AspImage support GIF?
A: Unisys differentiates between servers and workstations in their GIF licensing policies. In the case of Web servers, they expect the operator of the Web server to pay $1500 a year to allow dynamic generation of GIF images. Our suggestion is to avoid GIF. We don't support GIF LZW (Unisys) under any conditions.
Men her er så en løsning. Det fylder lidt rigeligt, men det er klippet ud af et script som kan finde størrelsen på mange foskellige slags filtyper:
<html>
<head>
</head>
<body>
<%
Function AscAt(s, n)
AscAt = Asc(Mid(s, n, 1))
End Function
Function HexAt(s, n)
Dim lsH
lsH = Hex(AscAt(s, n))
If Len(lsH) <> 2 Then lsH = "0" & lsH
HexAt = lsH
End Function
Function ReadGIF(filen)
Dim fso, ts, s, HW, nbytes
HW = Array("","")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile(Server.MapPath("/" & filen), 1)
ts.Skip(6)
s = ts.Read(4)
HW(0) = HexToDec(HexAt(s,2) & HexAt(s,1))
HW(1) = HexToDec(HexAt(s,4) & HexAt(s,3))
ts.Close
ReadGIF = HW
End Function
Function isDigit(c)
If inStr("0123456789", c) <> 0 Then
isDigit = true
Else
isDigit = false
End If
End Function
Function isHex(c)
If inStr("0123456789ABCDEFabcdef", c) <> 0 Then
isHex = true
Else
ishex = false
End If
End Function
Function HexToDec(cadhex)
Dim n, i, ch, decimal
decimal = 0
n = Len(cadhex)
For i=1 To n
ch = Mid(cadhex, i, 1)
If isHex(ch) Then
decimal = decimal * 16
If isDigit(ch) Then
decimal = decimal + ch
Else
decimal = decimal + Asc(uCase(ch)) - Asc("A") + 10
End If
Else
HexToDec = -1
End If
Next
HexToDec = decimal
End Function
' Billednavn
billede = "test.gif"
' Find størrelse på billede
Size = Readgif(billede)
' Udskriv størrelsen
response.write "Størrelse: " & Size(0) & " x " & Size(1)
%>
</body>
</html>