There are a few components that allow you to do this; here are two of them:
ShotGraph ASPImage The following components are specialized for creating charts and/or graphs from ASP:
ASPGFX ChartDirector Chart FX DundasChart IntrChart PopChart Image Server The following free component will tell you the properties of a local image file:
ImageSize Finally, you can determine the dimensions of an image without a component. If you are running Windows XP or Windows Server 2003, see
Article #2296. Otherwise, see this article on LearnASP.com:
http://www.learnasp.com/learn/graphicdet... I found this script a bit buggy with JPG files produced by certain filters in Photoshop, and some readers have reported that images with width and/or height >= 1000 pixels are not reported correctly. Also, thanks to Bryan O'Malley and Thomas Honoré Nielsen, here is a correction of the ReadJpg function from the above link:
Function ReadJPG(file) Const maxJpegSearch = 2048 Dim fso, ts, s, HW, nbytes, x, SOF HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & file), 1) s = ts.Read(maxJpegSearch) ts.Close for x = 1 to Len(s) - 1 if Asc(Mid(s, x, 1)) = &hFF then if Asc(Mid(s, x + 1, 1)) >= &hC0 AND _ Asc(Mid(s, x + 1, 1)) <= &hCF AND _ Asc(Mid(s, x + 1, 1)) <> &hC4 then SOF = x exit for end if end if next if SOF > 0 then s = Mid(s, SOF + 5, 4) HW(0) = HexToDec(HexAt(s,3) & HexAt(s,4)) HW(1) = HexToDec(HexAt(s,1) & HexAt(s,2)) else HW(0) = -1 HW(1) = -1 end if ReadJPG = HW End Function |
And here is how the HexToDec function should look:
<% Function HexToDec(cadhex) HexToDec = CLng("&H" & cadhex) End Function %> |