Page 1 of 1

command line limit overflow

Posted: 2007-02-05T13:40:27-07:00
by chanoy
Hi,

My program uses ImageMagick with Windows command line to let user add annnotations to an image. Sometimes they add a lot of annotations and eventually the command line becomes too long and I get errors. I saw this in the IMv6 Example doc:

"The "mogrify" version is the same as the "convert" command (with no initial input images), but will but will generate automatic thumbnails of every JPEG image in the current directory. The image argument is quoted so that IM itself will scan the directory, and not the command line shell. This prevents 'line limit overflow errors' on directories containing a huge number of images."

Is there a similar solution for my problem? Like passing in a file name that contains the parameters, etc...

Thanks,
onyee

Re: command line limit overflow

Posted: 2007-02-05T16:52:28-07:00
by rmagick
If you're using -annotate see http://redux.imagemagick.org/script/com ... p#annotate.

If you're using -draw you can put the primitives in a file such as myprimitives.txt and use
"-draw @myprimitives.txt"

Re: command line limit overflow

Posted: 2007-02-06T10:40:10-07:00
by chanoy
Hi, thanks for your reply. I try the primitives file and it works as you said. However, the user can draw each shape in a different color. When I try to put that info in the file, it doesn't seem to work (black and white seems ok, but not blue and probably other colors). For example,

myprimitives.txt:

fill rgb(255, 255, 255)
line 0 0 50 50
fill rgb(0, 0, 0, 0)
line 0 10 50 50
fill rgb(0, 0, 128)
polygon 10 20 10 30 10 10
font arial
pointsize 40
text 50 50 'hello'
...

I guess it's because the file is suppose to contain only the primitives, but I need to specify the color, font, etc each time before I draw a shape. Does the "convert" command takes in a file of parameters? Is there other to overcome this problem?

Thank you,
onyee

Re: command line limit overflow

Posted: 2007-02-06T11:10:36-07:00
by magick
Try wrapping your fill color with quotes (e.g. 'rgb(0,0,0)').