简体   繁体   中英

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;

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM