473,386 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

exec w. imagemagick gives incomplete result

Hi. Trying to generate some images with imagemagick. The following
works on
the command line:

/usr/local/bin/convert xc:yellow -resize 100x15! -gravity "West" -draw
"text 0,0 'Path Two'"
/Users/morten/Sites/cebra/images/a1a2e65dce30f01861c60d0acb5287c7.jpg

But when running via PHP exec, the yellow box gets created alright,
but the text doesn't
show.

exec($CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
\"West\" -draw \"text 0,0 \'".$text."\'\" ".$file, $out, $err);

Any suggestions?

Thanks.

Morten
Jul 17 '05 #1
2 3549
Morten wrote:
But when running via PHP exec, the yellow box gets created alright,
but the text doesn't show. exec($CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
\"West\" -draw \"text 0,0 \'".$text."\'\" ".$file, $out, $err); Any suggestions?


Try echo instead of exec

echo $CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
\"West\" -draw \"text 0,0 \'".$text."\'\" ".$file;
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
Pedro Graca <he****@hotpop.com> wrote in message news:<br************@ID-203069.news.uni-berlin.de>...
Morten wrote:
But when running via PHP exec, the yellow box gets created alright,
but the text doesn't show.

exec($CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
\"West\" -draw \"text 0,0 \'".$text."\'\" ".$file, $out, $err);

Any suggestions?


Try echo instead of exec

echo $CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
\"West\" -draw \"text 0,0 \'".$text."\'\" ".$file;


And pasting the result of echo into a term works. I've found that this is
highly likely to be due to imagemagick convert invokes another executable
which is in /usr/local/bin and this path is not part of the PATH visible
to PHP (according to phpinfo()). How do I add it?

Thanks,

Morten
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: PeterF | last post by:
Hi, I've got the following problem: exec() and shell_exec(), etc. don't give anything back, just the error code 127 (command not found?!) For example, the following script: <?php exec("cat...
4
by: Andrew Crowe | last post by:
Hi guys, I'm having trouble executing commands using exec() or system() that need to write files. I've set the permissions on CMD.EXE but I can't use exec() to write any files, even if the...
1
by: Geoff Soper | last post by:
I'm using ImageMagic under UNIX via the exec() function. I'm using it to ascertain the dimension of JPEGs. The code which is causing problems is below, I've used debugging code to try and work out...
0
by: Andrew Crowe | last post by:
Hi guys, I'm having some trouble using the exec() command on a Windows 2000 / IIS server (PHP5rc2 running as ISAPI). I can execute programs fine, but they are unable to interact with any files...
3
by: Joe | last post by:
Hey I have tried to install ImageMagick on my server, but my apache stalls when i try to start it with the following line added to my php.ini file: extension=php_imagick.dll I can't even...
4
by: Andrew Crowe | last post by:
Hi guys, I'm using ImageMagick to do scaling / filtering to uploaded images by calling the following: exec("cmd.exe /c convert.exe -filters in.jpg out.jpg"); This works flawlessly on our...
3
by: news | last post by:
My Web host apepars to not allow exec() and system(), as a line in my script: system("convert -scale 100x100 $uploadfile $toimage"); gives the error: "Warning: system() has been disabled...
3
by: ajh | last post by:
Using Ubuntu 5, Apache2 and PHP 4 I am trying display in a web browser the output from a program I wrote in C. Here is an abridged version of my code (I can post all of it later): <?php ...
6
by: Jeff | last post by:
I need to rewrite some image resizing code from perl to php. Although I'm currently using Image Magick in perl, the function reference is so different, that I'll completely need to rewrite it....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.