"The command line is too long."

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
CyberShadow
Posts: 14
Joined: 2010-05-02T18:05:02-07:00
Authentication code: 8675308

"The command line is too long."

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: "The command line is too long."

Post 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
CyberShadow
Posts: 14
Joined: 2010-05-02T18:05:02-07:00
Authentication code: 8675308

Re: "The command line is too long."

Post 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 :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: "The command line is too long."

Post 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
CyberShadow
Posts: 14
Joined: 2010-05-02T18:05:02-07:00
Authentication code: 8675308

Re: "The command line is too long."

Post by CyberShadow »

Never mind; see my new thread here.
Post Reply