[PHP] Problem getting imagemagick to work with php...

2001-10-30 Thread Brian Aitken

Hiya

I need to be able to automatically change the format and size of an image
when a user uploads it and using imagemagick's tools seems like the way to
go about it.

Unfortunately the server I'm using is Windows based and it doesn't have
imagemagick installed.  I downloaded the Windows imagemagick binaries and
the tools work fine locally from the dos prompt.

I hoped that uploading these files to a directory on the server would allow
my PHP script to use the tools, but either I'm typing in the wrong commands
or the tools won't work on the server.

When I try this little test script:
*

$file1 = \\images\\gladius.tiff;
$file2 = \\images\\gladius.jpg;

$command = \\imagemagick\\convert .$file1. .$file2;
$result = system($command);
if ($result)
{
 echo(Conversion Done!brimg src = gladius.jpg);
}

*

I get:
Warning: Unable to fork [\imagemagick\convert \images\gladius.tiff
\images\gladius.jpg] in 

I've tried using unix slashes and single slashes.  I've also tried running
the script in the imagemagick directory - I didn't get the 'fork' error but
the system function returned false.  I also tried using exec(), passthru()
and backticks but none of them worked (backticks gave a weird CGI error
message).

Anyone know what I'm doing wrong?  Does Imagemagick need to be installed in
some special place on the server?

Thanks
Brian



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem getting imagemagick to work with php...

2001-10-30 Thread Mark

On Tue, 30 Oct 2001 16:05:42 -, Brian Aitken wrote:
Hiya

I need to be able to automatically change the format and size of an
image
when a user uploads it and using imagemagick's tools seems like the
way to
go about it.

Unfortunately the server I'm using is Windows based and it doesn't
have
imagemagick installed.  I downloaded the Windows imagemagick
binaries and
the tools work fine locally from the dos prompt.

I hoped that uploading these files to a directory on the server
would allow
my PHP script to use the tools, but either I'm typing in the wrong
commands
or the tools won't work on the server.

When I try this little test script:
*

$file1 = \\images\\gladius.tiff;
$file2 = \\images\\gladius.jpg;

$command = \\imagemagick\\convert .$file1. .$file2;
$result = system($command);
if ($result)
{
 echo(Conversion Done!brimg src = gladius.jpg);
}

it looks like you're getting the path wrong.
try it like this:

echo `c:\\imagemagick\\convert c:\\images\\gladius.tiff
c:\\images\\gladius.jpg`;

in unix you can redirect stderr into stdout to see any error messages
like so:
echo `convert $file1 $file2 21';

you can't do this in windows, but I remember finding a dos program
called stderr.exe that you can pipe commands into that does the same
thing.

one possibility that comes to mind is maybe you don't have write
access to the temp directory convert uses.

also try checking apache's error log and posting the results.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]