PDA

View Full Version : animated gifs in perl to php


helraizer
06-15-2008, 01:53 PM
Hey,

I have a PHP script that I made for an image based shoutbox with emoticons. The problem is that php GD doesn't support animated gifs, yet perl GD does. How would I make it so that I could copy the animated gifs via Perl onto the static image that I made with php? I've tried with php imagecreatefromgif(), which produces a static image. I also tried using the GIFAnimation class from phpclasses to make an animated gif but it returns it as an object or a string, not an image resource. So if I use imagecreatefromstring it will again be static..


http://www.helraizer.co.uk/mychatbox/user/helraizer1.png

As you can see it has static emoticons. Like a normal shoutbox, but in an image form. I was wondering whether there is any possible way to use Perl GD to animate the gifs within GD (since the files themselves are animated). Then with these animated gifs imagecopymerge them onto the shoutbox image, as I am doing now. Therefore having the emoticons animated on the shoutbox image.

Hope that makes more sense.. Is that possible?

I must admit I've not used much Perl before, at all.

Sam

derzok
06-18-2008, 02:57 PM
I'm guessing you've already read the documentation on GD, but in case you missed it, read the user comments on this manual page: http://us2.php.net/imagegif you'll see a bunch of discussion on it. Here are a few of the more important looking posts:

http://us2.php.net/manual/en/function.imagegif.php#67933
http://us2.php.net/manual/en/function.imagegif.php#68863
http://us2.php.net/manual/en/function.imagegif.php#61311
also: http://www.phpclasses.org/browse/file/17973.html

Looks like there are multiple solutions.

Edit: Just go to the man page and search for "animate" and you'll find lots of references to making animated gifs.

oesxyl
06-18-2008, 03:03 PM
I'm guessing you've already read the documentation on GD, but in case you missed it, read the user comments on this manual page:
op have a similar thread in the php forum and this answer is more usefull there then here, :)

regards