misha
misha

Reputation: 301

PHP imagecreatefromgif is not creating animated gif from path

I am trying to get animated gif image from path. However I am getting gif that is not animated

$im = imagecreatefromgif($path);
$newFilePath = app()->basePath("public/memes/") . $newname .'.gif';
header('Content-Type: image/gif');
imagegif($im, $newFilePath);
imagedestroy( $im );
return $newFilePath;

Upvotes: 0

Views: 881

Answers (1)

naklar
naklar

Reputation: 249

manual - "When reading animated GIF files into memory, only the first frame is returned in the image resource pointer."

Take a look at http://phpimageworkshop.com/tutorial/5/manage-animated-gif-with-imageworkshop.html

Upvotes: 5

Related Questions