I know this is a real clumsy way of doing it but its simple enough for me to understand.
%%a = original bunch of files with original filenames
%%~na-007-a.jpg = Post processed %%a with "-007-a" suffix added to the filename inside folder "Blues"
%%~na.jpg = appended files with the original filenames (i.e. %%a) inside folder "Done"
I can get all of them to do -append or +append but when I try tiling them using parenthesis, they don't work. My ultimate goal is set conditions for appending horizontally or vertically e.g.
Code: Select all
Set Filesize=1000000
::A/B/C (if 3 files exists and file "a" is smaller/equal than 1mb, append them vertically)
For %%a in (*.jpg) do (
IF EXIST "Blues\%%~na-007-c.jpg" AND "Blues\%%~na-007-a.jpg" LEQ %Filessize% (
convert Blues\%%~na-007-a.jpg Blues\%%~na-007-b.jpg Blues\%%~na-007-c.jpg -background grey -append Done\%%~na.jpg
::A/B+C/D+E/F (if 4-6 files exists and file "a" is smaller/equal than 1mb, append them in tiles)
) ELSE IF EXIST "Blues\%%~na-007-d.jpg" AND "Blues\%%~na-007-a.jpg" LEQ %Filessize% (
convert Blues\%%~na-007-a.jpg Blues\%%~na-007-b.jpg -background grey -append Done\%%~naPART1.jpg
convert Blues\%%~na-007-c.jpg Blues\%%~na-007-d.jpg -background grey -append Done\%%~naPART2.jpg
convert Blues\%%~na-007-e.jpg Blues\%%~na-007-f.jpg -background grey -append Done\%%~naPART3.jpg
convert Done\%%~naPART1.jpg Done\%%~naPART2.jpg Done\%%~naPART3.jpg -background grey +append Done\%%~na.jpg
del *PART?.jpg
::A B C D E F (if file "a" is larger than 1mb, append horizontally)
) ELSE IF EXIST "Blues\%%~na-007-a.jpg" AND "Blues\%%~na-007-a.jpg" GTR %Filessize% (
convert ^
Blues\%%~na-007-a.jpg Blues\%%~na-007-b.jpg ^
Blues\%%~na-007-c.jpg Blues\%%~na-007-d.jpg ^
Blues\%%~na-007-e.jpg Blues\%%~na-007-f.jpg ^
-background grey +append Done\%%~na.jpg
)
)
As usual, it is not working