hi,
I am trying to generate text with rotation, no background color, and not defining the size. The command which i am using is working fine on my windows machine:
C:/im/convert -background none label:"fsdfds" -fill #ff0000 -font Arial -pointsize 12 C:/public_html/text.png
but the same command on my server which is on linux is not working (not generating any image):
/usr/bin/convert -background none label:"fsdfds" -fill #ff0000 -font Arial -pointsize 12 /home/public_html/text.png
not even this:
/usr/bin/convert label:"fsdfds" -fill #ff0000 -font Arial -pointsize 12 /home/public_html/text.png
/usr/bin/convert -background none label:"fsdfds" -font Arial -pointsize 12 /home/public_html/text.png
but however this works:
/usr/bin/convert label:"fsdfds" -font Arial -pointsize 12 /home/public_html/text.png
I have referred the documentation the syntax is correct but i cant figureout the reason of its failure. I can not see any error messages as i am using PHP to use this command as a system call, and it does not give any errors.
please help
thank you
label not generating
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: label not generating
specify all the settings before the label:
convert -background none -fill #ff0000 -font Arial -pointsize 12 label:"fsdfds" C:/public_html/text.png
In many cases IM processes from left to right, so settings need to be specified before the command.
convert -background none -fill #ff0000 -font Arial -pointsize 12 label:"fsdfds" C:/public_html/text.png
In many cases IM processes from left to right, so settings need to be specified before the command.
Re: label not generating
ok i tried this but did not work as well:
/usr/bin/convert -background none -fill #ff0000 -font Arial -pointsize 12 label:"fsdfds" /home/public_html/svg/text.png
/usr/bin/convert -background none -fill #ff0000 -font Arial -pointsize 12 label:"fsdfds" /home/public_html/svg/text.png
Re: label not generating
Try this to see if you get any errors:
Code: Select all
<?php
$array=array();
echo "<pre>";
exec("/usr/bin/convert -background none -fill #ff0000 -font Arial -pointsize 12 label:"fsdfds" /home/public_html/svg/text.png 2>&1", $array);
echo "<br>".print_r($array)."<br>";
echo "</pre>";
?>
Re: label not generating
empty array
array ()
array ()
Re: label not generating
Just seen an error in my code as I should have escaped the " around the text:
Its strange you are not getting and error; I will have to try it when I get home.
Code: Select all
<?php
$array=array();
echo "<pre>";
exec("/usr/bin/convert -background none -fill #ff0000 -font Arial -pointsize 12 label:\"fsdfds\" /home/public_html/svg/text.png 2>&1", $array);
echo "<br>".print_r($array)."<br>";
echo "</pre>";
?>
Re: label not generating
ya i escaped at my side. But i dont know why i am getting an empty array and its not generating anything if i put '-background none -fill #ff0000'
Re: label not generating
ok i fixed the problem myself. the problem was with fill I had to put it in quotes like "#ff0000"
so its working now:
/usr/bin/convert -background none label:"hello" -fill "#ff0000" -font Arial -pointsize 12 /home/public_html/text.png
so its working now:
/usr/bin/convert -background none label:"hello" -fill "#ff0000" -font Arial -pointsize 12 /home/public_html/text.png
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: label not generating
Remember when PHP executes a string....
PHP does its quotes, backslash and variable substitutions
Shell then splits up arguments and does its own variable and quote substitutions
and also does the "2>&1" file descriptor redirections (so PHP can read the errors on stdout)
ImageMagick gets a argument array, but will also do its own filename meta-character handling
specifically for DOS (the dos environment doesn't handle meta-chars) and for arguments such as
coder:*.gif[50x50] which the shell fails to expand due to coder: prefix or the [...] read modifier.
That is a LOT of argument parsing!
See IM examples PHP Shell
http://www.imagemagick.org/Usage/api/#php_example
PHP does its quotes, backslash and variable substitutions
Shell then splits up arguments and does its own variable and quote substitutions
and also does the "2>&1" file descriptor redirections (so PHP can read the errors on stdout)
ImageMagick gets a argument array, but will also do its own filename meta-character handling
specifically for DOS (the dos environment doesn't handle meta-chars) and for arguments such as
coder:*.gif[50x50] which the shell fails to expand due to coder: prefix or the [...] read modifier.
That is a LOT of argument parsing!
See IM examples PHP Shell
http://www.imagemagick.org/Usage/api/#php_example
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/