Page 1 of 1

The command line is too long.

Posted: 2011-03-21T09:39:35-07:00
by matt
I skimmed the forums and noting these two threads:

viewtopic.php?f=1&t=16133
viewtopic.php?f=2&t=16135

I am experiencing the same issue where our system dynamically generates the command-line and sometimes our command lines are rather long and exceed the limit in Windows (>8K). I love the idea of being able to supply all extra information for 'convert' as a file with some nice simple syntax such as:

convert @C:\options.txt
or
convert -options "C:\options.txt"
or something similar.

Based on my reading above the patch supplied does not address this. Was this ever added to ImageMagick or is it possible? It is quite difficult to split the command line since it is dynamically generated.

Thanks for the info!.

Matt

Re: The command line is too long.

Posted: 2011-03-21T19:26:46-07:00
by anthony
Topic moved to "developers" forum, as being more appropriate.

At this time all the Imagemagick CLI interface rely on having a array of ALL command line arguments in memory so that it can scan and process all the options as needed. It is actually overly complex, as a legacy from its development from IM v5 'option style' handling of arguments.

It actually needs to be this way for "mogrify" to work as it does, as well as for 'IM v5 legacy option' handling.

Reading commands and options from a file is something that is being worked toward for IM v7 but requires a major re-write of the CLI interface, and perhaps a special 'script' type command.

A stop gap measure may be to simply read in the arguments as a 'string' and parse them into memory, in a similar way that shells do. That will need some 'shell-like' quote handling, but that may be easier than a full re-write.

HOWEVER such a method would be a all or nothing option handling. It will not be able to input some options form a file in the middle of existing options. Also it will not handle 'pipelining' or 'remote control' of imagemagick commands. IM should be able to do this, but again, only if argument handling is completely re-organised.

Re: The command line is too long.

Posted: 2011-03-22T05:33:43-07:00
by matt
Hi Anthony,

I will eagerly await version 7 for such a feature in the meantime I'll try to determine a way to 'splice' my commands down to smaller sizes. I appreciate the detailed feedback.

Thanks!

Matt