The problem
"command line parsing can cause basically arbitrary residual text" is actually noting to do with Imagemagick at all. It is the shell, PHP, perl, ruby, etc etc etc, that is doing this, can can do it for ANY command.
In your example it is more commonly causes by a invisible space after the end-of-line '\'
for example
Code: Select all
echo hello cruel \
world
-bash: world: command not found
Where without the extra space it works just fine.
Code: Select all
echo hello cruel \
world
hello cruel world
nothing to do with the command itself, just shell syntax.
Whatever your wrapping language, you need to obey its syntax.
For example...
Code: Select all
convert rose: -virtual-pixel background -background Green \
-distort Perspective ' 0,0 20,5
0,46 5,30
70,0 65,10
70,46 55,44' show:
Which looks strange without the end-of-line '\' but is perfectly valid shell...The trick is to use quoting to prevent the shell seeing the newline, which IM in many cases will ignore as 'whitespace' in its arguments.
For variations is line-by-line syntax handling in PHP see...
http://www.rubblewebs.co.uk/imagemagick ... xplain.php
This is even worse than just plain shell as the line is interpreted by PHP, then shell, and finally individual arguments by ImageMagick! At least in Perl you can launch commands with you doing the 'argument sub-division' yourself, and avoiding the shell all together, PHP does not provide that facility!
To allow IMv7 to do stream handling I also have to build some argument sub-division handling in IM...