Gif Image is not animated after making watermark
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gif Image is not animated after making watermark
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?
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
What happened to the OP?
Anyway this works for me:
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
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.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
On the Windows computer try uninstalling and re installing Imagemagick.
Re: Gif Image is not animated after making watermark
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)
Last edited by psanjib on 2014-02-17T07:40:46-07:00, edited 2 times in total.
Re: Gif Image is not animated after making watermark
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?
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?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gif Image is not animated after making watermark
What error messages do you get from
Put in your proper full path to convert. You can find that from
or ask your ISP
Do you have read and write permissions for the directory where you images reside?
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>";}
?>
Code: Select all
exec("type -a convert",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
Do you have read and write permissions for the directory where you images reside?
Re: Gif Image is not animated after making watermark
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
that shows me /usr/bin/convert
but while i run the below code
that not working
please suggest me, what i have to do.
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>";} ?>
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>";}
?>
please suggest me, what i have to do.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gif Image is not animated after making watermark
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>";}
?>
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
Code: Select all
<?php exec("/usr/bin/convert h8Hjm.gif tmp.gif",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
when i used this one nothing echo but the tmp.gif created in same directory. it seems that works fine
Last edited by psanjib on 2014-02-19T22:59:30-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gif Image is not animated after making watermark
I am at a loss to know what else to suggest. It should work! Perhaps exec does not like the null: (colon). Try
or
(Bonzo, does this work for you on your PHP server?)
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>";}
?>
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>";}
?>
Re: Gif Image is not animated after making watermark
Sorry not working in php server.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gif Image is not animated after making watermark
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?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gif Image is not animated after making watermark
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>";}
?>
<?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
http://www.gif-king.com/test/index.php - this is the link where i test.
when i use this code
the image shows and no message print echo "$text<br>";
when i use this code
the image not shows also no error message not printed
dropbox link-
https://www.dropbox.com/s/zwxfugeeswam7ki/index.php
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>";}
?>
dropbox link-
https://www.dropbox.com/s/zwxfugeeswam7ki/index.php
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gif Image is not animated after making watermark
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>";}
?>
<?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>";}
?>