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
Branding
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Branding
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.
snibgo's IM pages: im.snibgo.com
Re: Branding
not work:/ i cant see a new file "DSC_logo.jpg" in my directory
Re: Branding
You do not need the echo on the exec( ) line.
Try this and see if you get any other errors:
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.
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 \">";
?>
Re: Branding
Maybe you should try to specify the absolute path to the file 'usr/bin/composite', e.g. /home/name/usr/bin/composite.