Page 1 of 1

"The command line is too long."

Posted: 2010-05-02T18:16:13-07:00
by CyberShadow
I'm trying to run convert with a long line of -draw commands, however I hit Windows' command line limit pretty quickly. Is there a way to get convert to read commands from a file? I couldn't find anything in the documentation, and the standard @filename.txt syntax didn't work.

Re: "The command line is too long."

Posted: 2010-05-02T18:41:45-07:00
by fmw42
Don't know. But it won't help as your Windows parser will likely see the whole file as one (too long) string anyway.

But you could write a script to loop over groups of commands writing to an mpc (memory mapped image) as a temp file. see http://www.imagemagick.org/Usage/files/#mpc

Re: "The command line is too long."

Posted: 2010-05-02T18:46:05-07:00
by CyberShadow
fmw42 wrote:Don't know. But it won't help as your Windows parser will likely see the whole file as one (too long) string anyway.
I don't see how that can be true. Windows has an architectural limitation of 8191 characters for the command line, so the problem is in Windows, not ImageMagick. If convert could read the -draw operations from a file, this problem wouldn't exist.

I suppose this isn't possible without breaking up the command into subcommands. Consider this post as a feature request, then :)

Re: "The command line is too long."

Posted: 2010-05-02T19:01:32-07:00
by fmw42
Depends upon how IM sees the information from the file? IM does not process one draw command per command line from the file, it would take all the draw commands from a simple text file and put them together as one long command line; unless you make new command lines for each draw command and use a tmp file that is written and read for each draw command. That was why I suggested writing a script to break up your command into shorter segments.

You might be able to do a lot of draw commands by using an MVG or SVG file to do all the processing. see http://www.imagemagick.org/Usage/draw/#mvg_file and http://www.imagemagick.org/Usage/draw/#svg

Re: "The command line is too long."

Posted: 2010-05-02T20:14:13-07:00
by CyberShadow
Never mind; see my new thread here.