Crashing command line (Imagemagick script)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Crashing command line (Imagemagick script)

Post 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 !
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Post Reply