Page 1 of 1

Crashing command line (Imagemagick script)

Posted: 2014-08-08T04:27:46-07:00
by Rye
I have got a REALLY weird problem...

I have a script... once a manual version and once a automatic one.


The manual version:

Code: Select all

@echo off
echo Make sure the images that have the background appended to have transparency
SET /P app=Drag and drop the image to be appended (as background):
for %%n in (*.gif) do convert -page +0+0  %app%   -page +0+0 %%n -flatten %%n
pause
works like a charm when I drag and drop the image on it.


the automatic version:

Code: Select all

move background.png %USERPROFILE%/Desktop/
set SRC="%USERPROFILE%/Desktop/background.png"
for %%n in (*.gif) do convert -page +0+0  %app%   -page +0+0 %%n -flatten %%n
Always crashes the commandline...

Any ideas ?

This is the first time I have encoutnered such stupid problem.


EDIT:
NEVERMIND: the problem is windows related.
If I put a TIMEOUT in before the automatic one:

Code: Select all

@echo off
timeout 1 > nul
for %%n in (*.gif) do convert -page +0+0  background.png   -page +0+0 %%n -flatten %%n
it suddenly works !