Page 1 of 1

Runtime.getRuntime().exec() cannot execute convert ?

Posted: 2010-05-24T00:31:33-07:00
by binocthex11

Code: Select all

cmd = String.format("convert -debug all c:\\abc\\background3.bmp %s\\result.gif -loop 0 %s\\final.gif", tempFolder, tempFolder);    	
run.exec(String.format("cmd.exe /c %s", cmd));
I use this to put a GIF on a background, but this does not work, nothing happened an no error is returned.

How could I use exec() to perform convert commands ?

Thanks!

Re: Runtime.getRuntime().exec() cannot execute convert ?

Posted: 2010-05-24T00:43:32-07:00
by binocthex11
binocthex11 wrote:

Code: Select all

cmd = String.format("convert -debug all c:\\abc\\background3.bmp %s\\result.gif -loop 0 %s\\final.gif", tempFolder, tempFolder);    	
run.exec(String.format("cmd.exe /c %s", cmd));
I use this to put a GIF on a background, but this does not work, nothing happened an no error is returned.

How could I use exec() to perform convert commands ?

Thanks!

OK, I've found the reason.
The animation result.gif in my code may not be prepared well for this convert command.

the -debug all option prints the message: unable open file result.gif

Hope it will be help for others.