Caption Challenge?

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
strudel67

Caption Challenge?

Post by strudel67 »

Hello - I am fairly new to imagemagick so not sure what to do with this. I have narrowed down a command that I run via a php script on a dedicated server. What we are trying to do is simply create a canvas and then drop a caption onto that canvas such that it sizes itself properly. Does anyone know why that periodically when called this command causes my server to stop working as the memory allocated for this operation gets sucked up and the server is no longer able to respond. Any help would be greatly appreciated - even a different way of performing this operation.

$command1 = IM_PATH."convert -background none -fill white -font Corsiva -size 400x50 caption:'".$_POST['tagline']."' ".SITE_URL."images/temp/caption.png";

$good1 = exec($command1);
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Caption Challenge?

Post by fmw42 »

strudel67 wrote:Hello - I am fairly new to imagemagick so not sure what to do with this. I have narrowed down a command that I run via a php script on a dedicated server. What we are trying to do is simply create a canvas and then drop a caption onto that canvas such that it sizes itself properly. Does anyone know why that periodically when called this command causes my server to stop working as the memory allocated for this operation gets sucked up and the server is no longer able to respond. Any help would be greatly appreciated - even a different way of performing this operation.

$command1 = IM_PATH."convert -background none -fill white -font Corsiva -size 400x50 caption:'".$_POST['tagline']."' ".SITE_URL."images/temp/caption.png";

$good1 = exec($command1);

I don't know why it might stop. But caption: will size the resulting image to fit the caption if you remove the -size 400x50 and specify a pointsize. Otherwise, if you want to have a fixed size, then you could use -annotate instead of caption.
Post Reply