I'm trying to run the montage
function in ImageMagick with a large number of arguments (264) directly through a ruby script. Here is the line that calls the function:
montage -mode concatenate -tile #{x_tiles}x#{y_tiles} #{tempfiles.map{|t| t.path}.join(' ')} #{final_filename}.jpg
This works for a smaller number of arguments (e.g. 10), but when I try to run this with a larger amount (230~) I get the following error:
Argument list too long
{list of all the arguments} (Errno: :E2BIG)
.
I'm using Windows so I tried both PowerShell and CMD, getting the same error.
Is there a way to overcome this in editing the command in ruby or otherwise (e.g. by globbing)? I tried to change the file ending as mentioned here but couldn't get the syntax right.