command line limit overflow

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply

command line limit overflow

Post by chanoy » 2007-02-05T13:40:27-07:00


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...


Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

Re: command line limit overflow

Post by rmagick » 2007-02-05T16:52:28-07:00

If you're using -annotate see ... 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

Post by chanoy » 2007-02-06T10:40:10-07:00

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,


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,

User avatar
Site Admin
Posts: 10918
Joined: 2003-05-31T11:32:55-07:00

Re: command line limit overflow

Post by magick » 2007-02-06T11:10:36-07:00

Try wrapping your fill color with quotes (e.g. 'rgb(0,0,0)').

Post Reply