Page 2 of 5

Re: Gif Image is not animated after making watermark

Posted: 2014-02-15T11:21:08-07:00
by fmw42
I am not an expert on this, but it looks to me like IM or PHP is not set up correctly. PHP cannot find the IM file magickwand.so or it is not installed. Did you install IM with everything defaulted or did you try to turn off some features.

The IM developers would have to comment on this for a proper answer as I really do not know.

Is this on a server? Did you or your ISP install Imagemagick?

Re: Gif Image is not animated after making watermark

Posted: 2014-02-15T12:19:29-07:00
by Bonzo
What happened to the OP?

Anyway this works for me:

Code: Select all

<?php  
$animation = 'h8Hjm.gif'; 

$watermark = 'WFr1K.png'; 

$watermarked_animation = 'watermarked.gif'; 

$cmd = " $animation -coalesce -gravity South ". 
" -geometry +0+0 null: $watermark -layers composite -layers optimize "; 

exec("convert $cmd $watermarked_animation "); 
 ?> 
 
 <img src="watermarked.gif">

Re: Gif Image is not animated after making watermark

Posted: 2014-02-15T12:25:02-07:00
by Bonzo
convert is /usr/bin/convert

also i am using windows 7
while i run this in php i got below warning warning message

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/magickwand.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/magickwand.so: cannot open shared object file: No such file or directory in Unknown on line 0

no echo, animation.gif not created
First you are talking about a server and then a Windows computer; it would be better to concentrate on one or the other and get that one working.

On the Windows computer try uninstalling and re installing Imagemagick.

Re: Gif Image is not animated after making watermark

Posted: 2014-02-17T00:14:06-07:00
by psanjib
kindly tell me which configuration need to set for water mark in .gif image (php version, imagemagic version, imagick module version, magickwand, etc if any require)

Re: Gif Image is not animated after making watermark

Posted: 2014-02-17T06:47:46-07:00
by psanjib
My ISP installed Imagemagick and magickwand
you can check http://www.gif-king.com/phpinfo.php

still then animation.gif not created, i think now my server set well, now what is problem?

Re: Gif Image is not animated after making watermark

Posted: 2014-02-17T11:00:20-07:00
by fmw42
What error messages do you get from

Code: Select all

<?php exec("/usr/bin/convert h8Hjm.gif null: WFr1K.png -gravity Center -layers composite -layers optimize animation.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
Put in your proper full path to convert. You can find that from

Code: Select all

exec("type -a convert",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
or ask your ISP

Do you have read and write permissions for the directory where you images reside?

Re: Gif Image is not animated after making watermark

Posted: 2014-02-18T03:44:34-07:00
by psanjib
i tried all possible way but not success yet, please check my sever configuration http://www.gif-king.com/phpinfo.php if any chnages need.
previously a warning message writes in error_log file that magickwand.so not loaded. after install no magickwand, now no error message shows.
when i execute the below code that shows

Code: Select all

<?php exec("type -a convert",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";} ?>
that shows me /usr/bin/convert

but while i run the below code

Code: Select all

<?php exec("/usr/bin/convert h8Hjm.gif null: WFr1K.png -gravity Center -layers composite -layers optimize animation.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
that not working
please suggest me, what i have to do.

Re: Gif Image is not animated after making watermark

Posted: 2014-02-18T10:38:56-07:00
by fmw42
Do you have read/write permission to the directory where you images are stored? Are they in your working directory? If not, then try the full path to the images.

Does this work?

<?php exec("/usr/bin/convert h8Hjm.gif tmp.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>

Re: Gif Image is not animated after making watermark

Posted: 2014-02-19T22:48:37-07:00
by psanjib

Code: Select all

<?php exec("/usr/bin/convert h8Hjm.gif tmp.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
<img src=tmp.gif> - image comes
when i used this one nothing echo but the tmp.gif created in same directory. it seems that works fine

Re: Gif Image is not animated after making watermark

Posted: 2014-02-19T22:57:53-07:00
by fmw42
I am at a loss to know what else to suggest. It should work! Perhaps exec does not like the null: (colon). Try

Code: Select all

<?php 
exec("/usr/bin/convert h8Hjm.gif null\: WFr1K.png -gravity Center -layers composite -layers optimize animation.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
or

Code: Select all

<?php 
exec("/usr/bin/convert h8Hjm.gif \"null:\" WFr1K.png -gravity Center -layers composite -layers optimize animation.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
(Bonzo, does this work for you on your PHP server?)

Re: Gif Image is not animated after making watermark

Posted: 2014-02-19T23:14:03-07:00
by psanjib
Sorry not working in php server.

Re: Gif Image is not animated after making watermark

Posted: 2014-02-19T23:15:44-07:00
by fmw42
Do you get any error messages? Do you not get any image returned? If you do get an image, can you post a link to it here. You can upload it to any free image hosting server such as dropbox (public folder) and put a link here?

Re: Gif Image is not animated after making watermark

Posted: 2014-02-19T23:18:09-07:00
by fmw42
Does this return an image? Perhaps it is the other image that is bad?

<?php
exec("/usr/bin/convert WFr1K.png tmp.png",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>

Re: Gif Image is not animated after making watermark

Posted: 2014-02-19T23:27:34-07:00
by psanjib
http://www.gif-king.com/test/index.php - this is the link where i test.

when i use this code

Code: Select all

<?php exec("/usr/bin/convert h8Hjm.gif tmp.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>


the image shows and no message print echo "$text<br>";

when i use this code

Code: Select all

<?php 
exec("/usr/bin/convert h8Hjm.gif \"null:\" WFr1K.png -gravity Center -layers composite -layers optimize animation.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
the image not shows also no error message not printed


dropbox link-
https://www.dropbox.com/s/zwxfugeeswam7ki/index.php

Re: Gif Image is not animated after making watermark

Posted: 2014-02-19T23:36:08-07:00
by fmw42
Perhaps the server is not animating or does not allow gif animations. FTP into your server and see if animation.gif is there and download it if necessary. Then drop it into your browser and see what happens. If it is not there, then I am at a loss. The following should work fine. I added a redirect of standard error to the command to see if that sends any messages.

<?php
exec("/usr/bin/convert h8Hjm.gif null: WFr1K.png -gravity Center -layers composite -layers optimize animation.gif 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>