Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Trying to create an automatic resize....
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

bo0oost
Starting Member

3 Posts

Posted - 08 July 2005 :  02:16:39  Show Profile  Visit bo0oost's Homepage
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?

my_max_size = (cint(trim(60))*100)
my_max_size = (10 * my_max_size)

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

http://www.prostreetonline.com

Edited by - bo0oost on 08 July 2005 02:18:02

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 08 July 2005 :  03:21:27  Show Profile  Visit MarcelG's Homepage
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

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

bo0oost
Starting Member

3 Posts

Posted - 10 July 2005 :  04:08:12  Show Profile  Visit bo0oost's Homepage
Anything to resize the images automatically for size? Thanks!!

http://www.prostreetonline.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07