Creating thumbnail cause no animation ?

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
harshil
Forum Newbie
Posts: 13
Joined: Fri Aug 01, 2008 1:21 am

Creating thumbnail cause no animation ?

Post by harshil »

Hi,

I have developed a function for creating 3 different size thumbnails of the passed image (jpg or gif).
But when I pass gif image, it is been converted into 3 different thumbnails but the animation that the image have is stopped.

The image behaves a still image. I could not find out why this happens.
Can anybody help me ??


Thanks !!
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Creating thumbnail cause no animation ?

Post by onion2k »

GD can't do animated gifs. You have four choices:

1. Write your own code to handle the animation. It's pretty hard though, so this isn't the best option if you're not great at PHP.

2. Live happily in the knowledge you're making the web better by having less annoying animated gifs. :)

3. Use imagemagick. That can do animated gifs. It'll depend on your host a bit though - it needs to be installed on the server before you can use it.

4. Wait. Animated gif support is coming to GD and to PHP at some point. Goodness knows when though, it might be years away.
harshil
Forum Newbie
Posts: 13
Joined: Fri Aug 01, 2008 1:21 am

Re: Creating thumbnail cause no animation ?

Post by harshil »

Hi onion2k,

Thanks for the reply. But GD can work with gifs.
I read few articles stating that between GD 2.0 and 2.0.28, gifs function were not allowed !
But after that gif function were in used !

Also in the forum I got that ! And I am using GD 2.0.28 so it should support gif.
I am using gif function & it is returning true value too.
But does not get the desired output !


If I am wrong then please notify me !!

Thanks !
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Creating thumbnail cause no animation ?

Post by onion2k »

It works with gifs. It doesn't work with animated gifs. GD can only see the first frame.
harshil
Forum Newbie
Posts: 13
Joined: Fri Aug 01, 2008 1:21 am

Re: Creating thumbnail cause no animation ?

Post by harshil »

Thanks onion2k !! :lol:
Post Reply