Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

Resizing photos

in classic ASP

7:59 pm on Sep 22, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 9, 2006
votes: 0


I want to adjust the size of photos that users upload to my website.

What could you do to the code below to adjust the size of the photos written to the website?

function showuserGROUPphotos(varfilenamethumb, varfilename, varimgtitle)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
varpath = server.mappath("usergroupphotos")
varfilepath = server.mappath("usergroupphotos")

varpath = varpath & "\" & varfilenamethumb
varfilepath = varfilepath & "\" & varfilename

If fs.FileExists(varpath) = true Then
varfilenamethumb = varfilenamethumb
varfilenamethumb = "nopic.jpg"
End If
If fs.FileExists(varfilepath) = true Then
varfilename = varfilename
varfilename = "nopic.jpg"
End If

showuserGROUPphotos = "<a href=""showaphoto.asp?gid=" & session("groupid") & "&vpath=usergroupphotos/" & varfilename & """><img src=""usergroupphotos/" & varfilenamethumb & """ class=""imgborder"" alt=""click photo to enlarge""/></a>"
end function

8:23 pm on Sept 22, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 24, 2005
votes: 0

You would probably have to write a custom COM component to do this. It might be possible to do in VBScript but it would be very complex (probably hundreds of lines of code) and very slow.
8:38 pm on Sept 22, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Feb 13, 2008
votes: 1

most of the host supports ASPJPEG.. ask from your host whether they support it or not. You can easily resize images using aspjpeg its just 3 lines of code.
4:17 pm on Sept 23, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 13, 2005
votes: 0

we used aspjpeg for years. easy to implement/use, especially if you have a dedicated server with access to install custom components.
10:18 am on Oct 14, 2008 (gmt 0)

New User

10+ Year Member

joined:Oct 14, 2008
votes: 0

ASP Jpeg and ASP Upload are both very good components and all good Windows Hosting should have it as a standard (In my opinion).

[edited by: Matt_C at 10:22 am (utc) on Oct. 14, 2008]


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members