I am trying to watermark images using imagemagick.
I can get the composite command to run in telnet, but not through php.
Heres my code:
$path='/home/sites/watermark/';
$newname='myimage2.jpg';
$pictodo=$path.'testpic.jpg';
$watermarkim=$path.'proof150.gif';
$filetowrite=$path.$newname;
$cmd = "/usr/local/bin/composite -geometry +100+150 $watermarkim $pictodo $filetowrite";
exec("$cmd, $exec_output, $exec_retval");
if ($exec_retval > 0)
{
print ("Error: exec() error: $exec_output[0]");
}
else
{
print ("Success, here the image<br><img src=\"$newname\">");
}
my apache log says:
composite: Unable to open file (,).
composite: Unable to open file (/home/sites/watermark/myimage2.jpg,) [No such file or directory].