Page 1 of 1

Branding

Posted: 2013-09-02T05:02:16-07:00
by leo20
Hello guys,

i wanna branding a logo on a picture, this is my code

<?php

echo exec("usr/bin/composite -gravity SouthEast logo-fz.png img-ready/DSC_6718_RESIZE.jpg img-ready/DSC_logo.jpg ");

echo "<img src=\"/img-ready/DSC_logo.JPG \">";


?>

but my code donĀ“t work, what is wrong ? i need help

Re: Branding

Posted: 2013-09-02T06:40:33-07:00
by snibgo
In your echo, you have a leading slash before the filename. This will look for the file in the root directory. The filename has a trailing space before the close quote, which might also cause problems.

Re: Branding

Posted: 2013-09-02T07:14:54-07:00
by leo20
not work:/ i cant see a new file "DSC_logo.jpg" in my directory

Re: Branding

Posted: 2013-09-02T07:38:53-07:00
by Bonzo
You do not need the echo on the exec( ) line.

Try this and see if you get any other errors:

Code: Select all

<?php 
$array=array(); 
echo "<pre>"; 
exec("usr/bin/composite -gravity SouthEast logo-fz.png img-ready/DSC_6718_RESIZE.jpg img-ready/DSC_logo.jpg 2>&1", $array);  
echo "<br>".print_r($array)."<br>"; 
echo "</pre>"; 
echo "<img src=\"/img-ready/DSC_logo.JPG \">";
?>  
As snibgo says there is a problem in your paths as you are using img-ready/DSC_logo.jpg in the exec( ) line and /img-ready/DSC_logo.JPG in the image display. Also one is a jpg file and the other is a JPG and Linux will treat those as different files.

Re: Branding

Posted: 2013-09-02T07:51:34-07:00
by dlemstra
Maybe you should try to specify the absolute path to the file 'usr/bin/composite', e.g. /home/name/usr/bin/composite.