Ok, so I have the Image Upload MOD, and it works great. Only thing is, users are uploading some huge pics... so I was trying to create something to automatically resize the images. Below is my code. It doesn't work... any ideas?
Dim fs,f Set fs=Server.CreateObject("Scripting.FileSystemObject") Set f=fs.GetFile(strPathTmp) currentLength = f.size currentLength1 = CurrentLength set f=nothing set fs=nothing
if currentLength > my_max_size then do while currentLength > my_max_size Executor.Application = thumbnailer & "nconvert.exe out jpeg -resize 90% " & trim(strPathTmp) Executor.TimeOut = 100
strResults = Executor.ExecuteDosApp Set fs=Server.CreateObject("Scripting.FileSystemObject") Set f=fs.GetFile(strPathTmp) currentLength = f.Size set f=nothing set fs=nothing
if currentLength = currentLength1 then exit do loop end if set Executor = nothing end if end if
bo0oost, there's a mod at SnitzBitz for this, which automatically resizes the picture upon load. It does NOT actually resize the picture upon saving it to your server, so the filesize remains the exact same size. See this mod at SnitzBitz: http://www.snitzbitz.com/mods/details.asp?Version=All&mid=137