The command line is too long.

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
matt
Posts: 4
Joined: 2010-08-17T06:33:10-07:00
Authentication code: 8675308

The command line is too long.

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: The command line is too long.

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
matt
Posts: 4
Joined: 2010-08-17T06:33:10-07:00
Authentication code: 8675308

Re: The command line is too long.

Post 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
Post Reply