Forum Moderators: open

Message Too Old, No Replies

Resizing photos

in classic ASP

         

Simon606

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

10+ Year Member



Hi

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
Else
varfilenamethumb = "nopic.jpg"
End If
If fs.FileExists(varfilepath) = true Then
varfilename = varfilename
Else
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

mrMister

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

WebmasterWorld Senior Member 10+ Year Member



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.

jojy

8:38 pm on Sep 22, 2008 (gmt 0)

10+ Year Member



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.

carguy84

4:17 pm on Sep 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



we used aspjpeg for years. easy to implement/use, especially if you have a dedicated server with access to install custom components.

Matt_C

10:18 am on Oct 14, 2008 (gmt 0)

10+ Year Member



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]