Geography Not Working After Switching Servers
Posted: 2011-02-24T17:33:27-07:00
Hi everyone! I've got a system built that creates dynamic ads for users, and places their contact info, headline & text on the ad and saves it as a new image. It's worked flawlessly for several years now, but I just moved it to a new hosting server (previously on MediaTemple Grid), and it's not behaving the same way. Specifically, all of the text displays correctly except one - the "caption" element, which shows up on the top-left of the image regardless of the "geometry" settings that I specify. All the other text elements are using the draw command, as they are single-line. But the body text must wrap, therefore it uses the "caption" command. This happens on every single ad - they all work except the body text.
I checked, and both servers are using the same version of ImageMagick (I intentionally installed the older version on the new server to match):
Old Server: ImageMagick 6.2.4 09/16/06 Q16 http://www.imagemagick.org
New Server: ImageMagick 6.2.4 09/17/10 Q16 http://www.imagemagick.org
Below is the code I'm using, which works fine on the old server, and again it renders on the new server, but with the body text in the top left. I've replaced the dynamic PHP variables with actual text & numbers so you can see it better.
I've tried a number of different techniques to get Geometry working again, but no matter what, it refuses to place the text at the coordinates I specify. I really need to get it working, otherwise I'll have to reprogram the entire system (and hundreds of ads) from scratch using GD, which I really don't want to have to do. Any help would be appreciated!
I checked, and both servers are using the same version of ImageMagick (I intentionally installed the older version on the new server to match):
Old Server: ImageMagick 6.2.4 09/16/06 Q16 http://www.imagemagick.org
New Server: ImageMagick 6.2.4 09/17/10 Q16 http://www.imagemagick.org
Below is the code I'm using, which works fine on the old server, and again it renders on the new server, but with the body text in the top left. I've replaced the dynamic PHP variables with actual text & numbers so you can see it better.
Code: Select all
exec("/usr/bin/convert -size '1275'x'1650' xc:white color_full1.png -geometry '1275'x'1650'!+0+0 -composite -fill black -font Arial.ttf -pointsize 48 -gravity Northwest -draw \"text 45,830 'HEADLINE GOES HERE'\" -font AvantGarde-Demi -pointsize 22 -gravity South -draw \"text 0,100 ' ADDRESS GOES HERE '\" -font AvantGarde-Demi -pointsize 34 -gravity Northwest -draw \"text 600,1000 'BULLET POINTS GO HERE'\" -font AvantGarde-Book -pointsize 20 -background transparent -size 480x -gravity Northwest -geometry '1275'x'1650'+45+950 caption:'BODY TEXT GOES HERE' -composite $savelocation");