Branding

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
leo20
Posts: 4
Joined: 2013-09-02T04:33:11-07:00
Authentication code: 6789

Branding

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Branding

Post 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.
snibgo's IM pages: im.snibgo.com
leo20
Posts: 4
Joined: 2013-09-02T04:33:11-07:00
Authentication code: 6789

Re: Branding

Post by leo20 »

not work:/ i cant see a new file "DSC_logo.jpg" in my directory
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Branding

Post 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.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Branding

Post by dlemstra »

Maybe you should try to specify the absolute path to the file 'usr/bin/composite', e.g. /home/name/usr/bin/composite.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply