Here's a quick one for all those of you out there who are tired of manually resizing their files and playing with the compression ratio to get them to be the right size.
I did use irfanview in the past for that, but that means opening ans saving each files one by one. I did use BDsizer before also but somehow wanted something smaller with no buttons, you know, one of those one trick ponies where you just drag a folder and it does its job?
Well, I wrote a small script just for that. Just copy the text and save it as a .bat or .cmd file. You can tweak the settings as you want.
Be warned though:
IT WILL OVERWRITE EVERY FILE WITH THE NEW SMALLER VERSION!In order to be able to run this script, you have to install the
ImageMagick command line tools.
Enjoy!
@ECHO OFF
rem change codepage to allow nice graphics ;-)
chcp 65001
CLS
rem Go to drag and drop folder
if "%~1" == "" exit
cd "%~1"
rem Get current dir name
for %%* in (.) do set CurrDirName=%%~n*
echo Forum JPG resizer
echo.
echo This program will resize any jpg to 800 pixels
echo wide or high and make a less than 200kb file.
echo this will overwrite all the files in %CurrDirName%
choice /m "Do you accept" /c YN
if errorlevel 2 goto end
if errorlevel 1 goto resize
goto end
:RESIZE
echo RESIZING
mogrify *.jpg -thumbnail 800x800 -define jpeg:extent=198kb *.jpg
echo Files resized
:END
echo thank you
pause