Cannot add text to my image
Cannot add text to my image
I cannot add text to my image.
This works fine, it draws the bezier.
exec("convert julekort/".$row["image"].".jpg -draw 'bezier 70,50 95,100 95,0 120,50' flower_annotate1.jpg");
But this writes no text
exec("convert julekort/".$row["image"].".jpg -draw \"text 100,100 'Works like magick!' \" flower_annotate1.jpg");
I have also tried to use annotate with no luck.
Could the host have blocked for working with text?
This works fine, it draws the bezier.
exec("convert julekort/".$row["image"].".jpg -draw 'bezier 70,50 95,100 95,0 120,50' flower_annotate1.jpg");
But this writes no text
exec("convert julekort/".$row["image"].".jpg -draw \"text 100,100 'Works like magick!' \" flower_annotate1.jpg");
I have also tried to use annotate with no luck.
Could the host have blocked for working with text?
Re: Cannot add text to my image
The text might be off your image; try this:
Code: Select all
exec("convert julekort/".$row["image"].".jpg -gravity center -draw \"text 0,0 'Works like magick!' \" flower_annotate1.jpg");
Re: Cannot add text to my image
Sorry, still no text. I suppose this should put the text right in the middle og the image. I only get the Background-image.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Cannot add text to my image
try with just one specific image hard coded in the command. perhaps it relates to your code for extracting the correct image or somewhere else in your code
try removing the space between the single and escaped double quote, though I would not expect that to be an issue.
also try escaping the !
try removing the space between the single and escaped double quote, though I would not expect that to be an issue.
Code: Select all
magick!' \"
Code: Select all
magick\!'\"
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Cannot add text to my image
I would first try an example with no spaces or punctuation. Then you (probably) don't need quotes or escapes in the string. Like this, at the command line:
Code: Select all
convert -size 100x100 xc: -draw "text 50,50 hello" h.png
snibgo's IM pages: im.snibgo.com
Re: Cannot add text to my image
exec("convert -size 100x100 xc: -draw 'text 50,50 hello' h.png"); just gives me a white image size 100x100px. So the text part doesn't work, ata least not on my server.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Cannot add text to my image
What version of IM are you using and on what platform? Perhaps it is time for an upgrade. Your version may have a bug?
Re: Cannot add text to my image
ImageMagick 6.6.7-1 2011-01-17
PHP Version 5.3.8
PHP Version 5.3.8
Re: Cannot add text to my image
I tested on another server with af slightly newer ImageMagisk, and there it works. I will move the files.
Thanks.
Thanks.