quicksilver Posted April 29, 2006 Share Posted April 29, 2006 Hi i want to convert all images in a Folder to the propotional size 800x??? an after the convert i wanted to upload the converted Files via FTP to my homepage. Has anyone an Idea for this Script? Thx for Help Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 29, 2006 Moderators Share Posted April 29, 2006 Hi i want to convert all images in a Folder to the propotional size 800x??? an after the convert i wanted to upload the converted Files via FTP to my homepage. Has anyone an Idea for this Script?Thx for HelpFirst I'd download and install Irfanview which is a great freeware graphics program. Then use it's command line options to run a batch job to convert your images. Then use the FTP UDF to upload them. Link to comment Share on other sites More sharing options...
quicksilver Posted April 30, 2006 Author Share Posted April 30, 2006 (edited) This is the ready Script. #include <File.au3> #include <FTP.au3> #include <file.au3> $server = 'server' $username = 'user' $pass = 'pass' $images = @ScriptDir&"\images\" $dir = @ScriptDir&"\images\800\" $filenames = @ScriptDir&"\images\*.jpg" $search = FileFindFirstFile($filenames) $tool = @ScriptDir & "\i_view32.exe" Run(@ScriptDir & "\i_view32.exe " & $images & "*.jpg /resample=(800,600) /aspectratio /convert="& $dir &"*.jpg","", @SW_MINIMIZE) $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $Ftpp = _FtpPutFile($Conn, $dir & $file, '/' & $file) WEnd FileDelete($dir&"*.jpg") MsgBox(0, "Hinweis", 'Fertig') $Ftpc = _FTPClose($Open) FileClose($search) But now i want to convert the filename of the destination file. i need a way to convert the follow letters to the specified letters ' to _ Uppercase letters to lowercase space to _ Edited April 30, 2006 by quicksilver Link to comment Share on other sites More sharing options...
Simucal Posted April 30, 2006 Share Posted April 30, 2006 (edited) $var = "ThIS iS a TesT' lOOk At m'E" MsgBox(0,"String Manipulation Example", StringLower(StringReplace(StringReplace($var," ", "_"), "'", "_"))) Edited April 30, 2006 by Simucal AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
quicksilver Posted April 30, 2006 Author Share Posted April 30, 2006 $var = "ThIS iS a TesT' lOOk At m'E" MsgBox(0,"String Manipulation Example", StringLower(StringReplace(StringReplace($var," ", "_"), "'", "_"))) ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $filenew = $file StringLower(StringReplace($filenew," ", "_")) $Ftpp = _FtpPutFile($Conn, $dir & $file, '/' & $filenew) WEnd is it wrong? it doesnt work Link to comment Share on other sites More sharing options...
Simucal Posted April 30, 2006 Share Posted April 30, 2006 (edited) ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $filenew = $file StringLower(StringReplace($filenew," ", "_")) $Ftpp = _FtpPutFile($Conn, $dir & $file, '/' & $filenew) WEnd StringLower(StringReplace($filenew," ", "_")) is just sitting there byitself. You have to store the result to a variable. e.g. $filenew = StringLower(StringReplace($filenew," ", "_")) Edited April 30, 2006 by Simucal AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
quicksilver Posted April 30, 2006 Author Share Posted April 30, 2006 Thx for Help The attachment ist the Script with all needed files to convert and upload the Images !ftp_upload.zip Link to comment Share on other sites More sharing options...
Zedna Posted April 30, 2006 Share Posted April 30, 2006 Yet another fix, instead of: Run(@ScriptDir & "\i_view32.exe " & $images & "*.jpg /resample=(800,600) /aspectratio /convert="& $dir &"*.jpg","", @SW_MINIMIZE) use this: RunWait(@ScriptDir & "\i_view32.exe " & $images & "*.jpg /resample=(800,600) /aspectratio /convert="& $dir &"*.jpg","", @SW_HIDE) so Run --> RunWait @SW_MINIMIZE --> @SW_HIDE Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted April 30, 2006 Share Posted April 30, 2006 Next bug: If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf must be immediatelly after $search = FileFindFirstFile($filenames) because in this case you don't need to create dir, convert images, open FTP and then exit (without closing FTP!). Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted April 30, 2006 Share Posted April 30, 2006 1) #include <File.au3> is twice 2) for reading from INI use IniRead() instead of FileReadLine($file,2) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
quicksilver Posted April 30, 2006 Author Share Posted April 30, 2006 (edited) ok thx for bugfixing not it works very Fine But another question.. is there any way to convert the images with autoit? Edited April 30, 2006 by quicksilver Link to comment Share on other sites More sharing options...
quicksilver Posted May 5, 2006 Author Share Posted May 5, 2006 (edited) i want to add a dropdown field in the tool to switch between different directories.. I want to specifie 3 directories in the tool and want to switch it with a dropdown before i upload the files! Is it easy? Or a hard way to create? Edited May 5, 2006 by quicksilver Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now