to anyone who is interested, here is my working concept...
I primary get a list of to processing pics with the following robocopy command (robocopy is a part of windows cmd line tools since xp sp3 >> win7):
robocopy "%FROM%" "%TO%" "%WHAT%" /MIN:%SIZE% /XD "%EXCLUDE%" /L /E /R:2 /W:2 /LOG:"%LOG%" /FP /NDL /NP /NJH /NJS /NS /NC
(parameter %TO% is only needed for proper robocopy working, and has no meaning for gaining the needed data, hence can contain any VALID path you like; %WHAT% is in my case "*.JPG" since we wanna use photoresizer who can only handle jpg's so far...)
after the log file (%LOG%) is written, it contains with above used parameters only the full path\filename.ext of files bigger then %SIZE% (in Bytes!!!), without any usual additional robocopy log information except error messages = nice way getting adapted file logs; See robocopy built in help "robocopy /?"
to start the photoresizer process I simply deliver the content of the logfile to photoresizer.exe with this qad script...
-
FOR /F "usebackq delims=" %%a in ("%LOG%") do set TEST=%%a& call :PRINT
goto :EOF
:PRINT
set CHECK=!TEST:~6,11!
if !CHECK! neq %SERVER% (
echo *INVALID LINE* -!TEST:~6!-
) else (
REM echo -!TEST:~6!-
PhotoResize.exe -e -q60 -x11 -p100 -i "-o<SRCPATH><EN>" "!TEST:~6!">>"%HOME%\PHORES.TXT"
)
goto :EOF
-
I'll describe the script only very quickly...
- FOR /F loop parameter "usebackq" is needed to parse paths/filenames with " " (Space) within correctly! without you'll get an error or you can only use paths/filenames without any " " inside!
- 2 times of "goto :EOF" are needed to run and close the FOR /F loop and calling sub routine properly! For more help see "for /?" "goto /?" and "call /?"
- in my case I'll check the logfile for unwanted additional robocopy error entries... I simply check the first 11 signs of the whole path line with an predefined string! if it doesn't match it'll be likely a robocopy error entry (considered my used robocopy parameters for a simple log creation only! YES, errors are STILL written even with above parameters!)
- to start the sign check with the predefined string at the current log line we HAVE to start at token position 6, because robocopy default formats the log entry lines with a bunch of tabs and white spaces BEFORE writing the path! (you may have to adjust the token position digit to your needs; I'm working with an german windows environment) of course if you don't wanna/have to check the log entries, you can avoid the "if else" construct and just deliver the path directly to photoresizer.exe with an simply FOR /F loop without calling a sub routine...
- the used photoresizer.exe parameters are tested properly by me and ONLY shrink the whole filesize without touching the rest of the pic (frame size, dpi, ratio, etc.)
- use the script suggestion like you wish... but don't blame me if you change/destroy your valuable pics without testing it before!
regards
Sparksman