AndrewFerrara Posted February 5, 2011 Share Posted February 5, 2011 So, We are trying to create a animation using the gifs in a directory by using the first 10 images. We just cannot figure out how to do the animation.. needs to have a 3 second delay between each frame Heres the code at the moment. Which creates the starting images and also sorts the images in the directory by time.. <?php $time = date("YmdHis"); $handle_data = file_get_contents('http://www.bungie.net/Stats/Halo3/Nightmap.ashx'); $img = new Imagick(); $img->readImageBlob($handle_data); $img->writeImage('nightmap/'.$time.'.gif'); foreach (glob('nightmap/*.gif') as $f) { # store the image name $list[] = $f; } sort($list);# sort is oldest to newest, $gif_0 = array_pop($list); $gif_1 = array_pop($list); $gif_2 = array_pop($list); $gif_3 = array_pop($list); $gif_4 = array_pop($list); $gif_5 = array_pop($list); $gif_6 = array_pop($list); $gif_7 = array_pop($list); $gif_8 = array_pop($list); $gif_9 = array_pop($list); ?> Link to comment https://forums.phpfreaks.com/topic/226833-creating-a-gif-from-images-in-a-directory/ Share on other sites More sharing options...
BlueSkyIS Posted February 5, 2011 Share Posted February 5, 2011 not a quick/easy thing to do. i suggest that you look over the comments here: http://php.net/manual/en/function.imagegif.php and google php animated gif http://www.google.com/search?client=safari&rls=en&q=php+animated+gif&ie=UTF-8&oe=UTF-8 Link to comment https://forums.phpfreaks.com/topic/226833-creating-a-gif-from-images-in-a-directory/#findComment-1170465 Share on other sites More sharing options...
litebearer Posted February 6, 2011 Share Posted February 6, 2011 also - http://www.phpclasses.org/package/3163-PHP-Generate-GIF-animations-from-a-set-of-GIF-images.html Link to comment https://forums.phpfreaks.com/topic/226833-creating-a-gif-from-images-in-a-directory/#findComment-1170477 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.