<% ' IMPORTANT: This script must not contain any HTML tags ' Create an instance of AspJpeg object Set jpeg = Server.CreateObject("Persits.Jpeg") imageUrl = request.QueryString("img") imageHeight = request.QueryString("h") imageWidth = request.QueryString("w") jpeg.Open(Server.MapPath(imageurl)) imgHeight = jpeg.OriginalHeight imgWidth = jpeg.OriginalWidth If imageHeight > 0 and imageWidth > 0 then 'if imgHeight > imageHeight OR imgWidth > imageWidth then 'Determine what dimension is off by more deltaWidth = imgWidth - imageWidth deltaHeight = imgHeight - imageHeight If deltaHeight > deltaWidth then 'Scale by the height scaleFactor = imageHeight / imgHeight Else 'Scale by the Width scaleFactor = imageWidth / imgWidth End If jpeg.Width = imgWidth * scaleFactor jpeg.Height = imgHeight * scaleFactor 'end if jpeg.Quality = 90 Jpeg.Interpolation = 1 'Send thumbnail data to client browser jpeg.SendBinary End If %>