NOTE: You can do that already -- using BASH!!!!!
And as PHP does not provide a nice way of running your convert command without the use of a shell (arrrggghhh...) you may as well use it.
Code: Select all
convert /dev/fd3 /dev/fd/4 /dev/fd/5 -append image-output.png
To find out if your 'PHP shell' is bash run
Code: Select all
<?php
header('Content-Type: text/plain');
system("exec 2>&1; echo shell is $SHELL");
?>
So if you are using BASH to generate the extra file descriptors than you
already have it.
Of course this does not help if you are avoiding the use of a SHELL
and in a perl script, or C programming. Also as this is probably
more to do with secure programing, it is probably a good idea.
However I would expand that idea to OUTPUT as well.
Code: Select all
convert rose: -write fd:5 -swirl 90 fd:6
But it may need some method of specifing the OUTPUT format
For example
Code: Select all
convert rose: -write jpeg:fd:5 -swirl 90 png:fd:6
WARNING WARNING WARNING.
While the large UNIX buffers will prevent a lot of problems with I/O deadlocks handling multiple streams of data can cause problems, unless each stream come from or goes to a completely separate parallel process. You need to be certain that IM can read all the data for each image, in the order given.
Your own script for example relies on the UNIX buffer being large enough to hold all the image data, as you write to the pipelines in the WRONG order!