Tech Support Guy banner

Imagemagick trouble.

2298 Views 5 Replies 2 Participants Last post by  foxidrive
So, I thought of this script (inorder to paste a "background.png" behind each of the gifs in a folder)


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


However it will stay stuck on the first image.

Ideas ?
Status
Not open for further replies.
1 - 6 of 6 Posts
I suspect that you have called the batch file convert and it is calling itself.
Pick another name like convertgif.bat and your loop also needs to change so that some files aren't processed more than once.

The double quotes are to handle spaces etc in filenames.

Code:
@echo off
for /f "delims=" %%x in ('dir *.gif /b /a-d ') do (
convert -page +0+0  "background.png"   -page +0+0 "%%x" -flatten "%%x"
)
pause
actually I called the "imagemagick" function "convert"
Sadly not...

like I said, the script calls an function called convert.

If you want to try yourself, download imagemagick, create a folder with similar sized gifs and one similar sized png:
http://www.imagemagick.org/script/download.php
That is indeed sad.

I tested it with imagemagick before I posted it. You have no clue.
1 - 6 of 6 Posts
Status
Not open for further replies.
Top