Page 1 of 1

Caption Challenge?

Posted: 2008-10-16T08:07:10-07:00
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);

Re: Caption Challenge?

Posted: 2008-10-16T11:02:36-07:00
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.