<%
function getimagesize(curwidth, curheight, newsizechange, newsizewhat, outputwh)
'##############################################
'Image Aspect Ratio Resize by Michael V Feranda
'##############################################
'curwidth -> This is the current width
'curheight -> This is the current height
'newsizechange -> This is the amount you want To ADD or take away
'newsizewhat -> This is what you want To ADD or take away the amount from (width or height)
'outputwh -> This is where you Select the new output size you want (width or height)
'Example of Use For a 800x600 image and change To a 640 width
' newwidth = getimagesize(800,600,-160,"width","width")
' newheight = getimagesize(800,600,-160,"width","height")
'##############################################
if ""& lcase(newsizewhat) &"" = "width" Then
resizeratio = newsizechange/(curwidth/100)
Else
resizeratio = newsizechange/(curheight/100)
End if
if ""& lcase(outputwh) &"" = "width" Then
getimagesize = cint(curwidth+((curwidth/100)*resizeratio))
Else
getimagesize = cint(curheight+((curheight/100)*resizeratio))
End if
End function
'Width: 800
'Height: 600
'I'm changing the width to 640 with the
' aspect ratio function
'To do this, i'll have to take away 160
' from 800, so I insert -160
%>
New Width: <%=getimagesize(800, 600, -160, "width", "width")%>
New Height: <%=getimagesize(800, 600, -160, "width", "height")%>