<% 'response.write Request("filename") Function URLDecode(sConvert) Dim aSplit Dim sOutput Dim I If IsNull(sConvert) Then URLDecode = "" Exit Function End If ' convert all pluses to spaces sOutput = REPLACE(sConvert, "+", " ") ' next convert %hexdigits to the character aSplit = Split(sOutput, "%") If IsArray(aSplit) Then sOutput = aSplit(0) For I = 0 to UBound(aSplit) - 1 sOutput = sOutput & _ Chr("&H" & Left(aSplit(i + 1), 2)) &_ Right(aSplit(i + 1), Len(aSplit(i + 1)) - 2) Next End If URLDecode = sOutput End Function ' Sample usage: ' http://www.whatever.com/quickpic.asp?filename=" & server.urlencode("D:\public\www\whatever\images\animage.jpg") & "&width=-1&height=200" ' QueryString Arguments (All Optional) ' BgColor=server.urlencode("#FFFFFF") ' Border=True ' Border Color=server.urlencode("#CCCCCC") ' BorderClip=INT(15) ' BorderClipCorner="UL"|"UR"|"LL"|"LR" 'Response.CacheControl = "Public" 'Response.Expires = 20 ' Twenty minutes 'If (StrComp(Right(request.querystring("filename"),4),".gif",1)=0 Or LEN(request.querystring("FORCEGIF")) > 0) And LEN(request.querystring("FORCEJPG")) < 1 then ' Response.ContentType = "image/gif" 'else ' Response.ContentType = "image/jpeg" 'end if 'dim myquickpic 'set myquickpic=server.createobject("WebGraphics.Quickpic") 'MyMsg=myquickpic.ReturnPic 'if MyMsg=FALSE > 0 then response.write "ERROR!
" ' Create an instance of AspJpeg object Set jpeg = Server.CreateObject("Persits.Jpeg") jpeg.Open( URLDecode(Request("filename")) ) ' Set new width 'jpeg.Width = Request("width") jpeg.Height = Request("height") ' Set new height, preserve original width/height ratio 'jpeg.Height = jpeg.OriginalHeight * jpeg.Width / jpeg.OriginalWidth jpeg.Width = jpeg.OriginalWidth * jpeg.Height / jpeg.OriginalHeight ' Send thumbnail data to client browser jpeg.SendBinary set jpeg=nothing %>