Gif Image is not animated after making watermark

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
User avatar
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

Post 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?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Gif Image is not animated after making watermark

Post 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">
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Gif Image is not animated after making watermark

Post 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.
psanjib
Posts: 20
Joined: 2014-02-04T23:03:41-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post 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)
Last edited by psanjib on 2014-02-17T07:40:46-07:00, edited 2 times in total.
psanjib
Posts: 20
Joined: 2014-02-04T23:03:41-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post 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?
User avatar
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

Post 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?
psanjib
Posts: 20
Joined: 2014-02-04T23:03:41-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post 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.
User avatar
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

Post 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>";}
?>
psanjib
Posts: 20
Joined: 2014-02-04T23:03:41-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post 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
Last edited by psanjib on 2014-02-19T22:59:30-07:00, edited 1 time in total.
User avatar
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

Post 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?)
psanjib
Posts: 20
Joined: 2014-02-04T23:03:41-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post by psanjib »

Sorry not working in php server.
User avatar
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

Post 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?
User avatar
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

Post 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>";}
?>
psanjib
Posts: 20
Joined: 2014-02-04T23:03:41-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post 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
User avatar
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

Post 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>";}
?>
Post Reply