I have a picture uploading PHP script, which handles png, jpg and jpeg images well. The problem is, that since I am using the combo of imagealphablending
, imagesavealpha
, imagecreatetruecolor
and imagecopyresampled
to resize the picture, the gif animation is lost. I am using imagecreatefromgif
to load the gif into memory.
I know one can use ImageMagick to achieve the desired result, but I wonder whether there is a solution with a combo of standard php functions to resize the gif without losing the animation. I there such a solution, or should I start to use a library?
It is possible to resize an animated GIF using GD (what you call "standard PHP").
You need to split the image into individual frames, resize them and then put everything back together.
You can see a more detailed explanation here.
However, I would really suggest you to use imagick, since it's easy to install and much easier to use for advanced tasks like this.
EDIT This is the relevant part from the answer I linked above: