Displaying an Image's Dimensions
I have a page that lists a table of slides pulled from an Access database displayed in a table on an ASP VBScripted page and want to determine the various image's widths and heights. I have a VBscript that works for a single image but does not work in a "Repeat Region".
The code to read the width & height is:
<%
dim iwidth, iHeight
sub ImgDimension(img)
dim myImg, fs
Set fs= CreateObject("Scripting.FileSystemObject")
if not fs.fileExists(img) then exit sub
set myImg = loadpicture(img)
iwidth = round(myImg.width / 26.4583)
iHeight = round(myImg.height / 26.4583)
set myImg = nothing
end sub
ImgDimension(Server.MapPath("/images/techtraining/" & rs_TSR.Fields.Item("tsr_Img").Value))
%>
The code I am using to display the width is:
<%= iwidth %>
Any suggestions on how to either rework this code or other code that I can use?
Thanks!
Andy
