shadysaiyan Posted September 8, 2008 Share Posted September 8, 2008 Does anyone know a code for making an animated gif from 2 or more images? also if so a way to add text over it too when it generates, because im looking to make animated userbars for my site. Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/ Share on other sites More sharing options...
dezkit Posted September 8, 2008 Share Posted September 8, 2008 Uhm, i don't think thats possible, if it really isn't, than you can use flash as an alternate Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-636276 Share on other sites More sharing options...
shadysaiyan Posted September 10, 2008 Author Share Posted September 10, 2008 its gotta be possible, Tripletags has them and they are generated corresponding to each users top 5 games. Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-638026 Share on other sites More sharing options...
The Little Guy Posted September 10, 2008 Share Posted September 10, 2008 Will one image always be the same? Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-638037 Share on other sites More sharing options...
shadysaiyan Posted September 10, 2008 Author Share Posted September 10, 2008 No, if you update your top game on your profile there, the userbar will change and have the image of the other game changing instead of Killzone 2. Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-638680 Share on other sites More sharing options...
The Little Guy Posted September 10, 2008 Share Posted September 10, 2008 Take a look at this: http://www.imagemagick.org/script/index.php Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-638694 Share on other sites More sharing options...
shadysaiyan Posted September 11, 2008 Author Share Posted September 11, 2008 Thanks, looked through that, but i dont know how to convert any of it to PHP, i found this though <? //FULL PATH TO WHERE YOU WANT TO SAVE $path = "/home/hsphere/local/home/USERNAME/yoursite.com/images/"; //THE COMMAND TO MAKE THE ANIMATION HAPPEN add more images if ya need to $cmd = "/usr/local/bin/convert -dispose none -delay 20 FIRSTIMAGE.gif -delay 20 SECONDIMAGE.gif -loop 0 $path/animatedimage.gif"; //EXECUTE THE COMMAND AND CAPTURE ANY ERRORS exec("$cmd 2>&1", $err); foreach($err as $errline){ echo("$errline<br>"); } ?> <!--display the animated image--> <img src='animatedimage.gif'> Source: http://support.jodohost.com/showthread.php?t=5513 I t looks like it works from the code, but when i run it in the browser, i get Parse error: syntax error, unexpected T_STRING in /home/content/s/h/a/shadysaiyan/html/0.php on line 7 Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639301 Share on other sites More sharing options...
Mchl Posted September 11, 2008 Share Posted September 11, 2008 See this guide for debugging Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639305 Share on other sites More sharing options...
The Little Guy Posted September 11, 2008 Share Posted September 11, 2008 Give this a try: <? //FULL PATH TO WHERE YOU WANT TO SAVE $path = "/home/hsphere/local/home/USERNAME/yoursite.com/images"; //THE COMMAND TO MAKE THE ANIMATION HAPPEN add more images if ya need to $cmd = "/usr/local/bin/convert -dispose none -delay 20 FIRSTIMAGE.gif -delay 20 SECONDIMAGE.gif -loop 0 {$path}/animatedimage.gif"; //EXECUTE THE COMMAND AND CAPTURE ANY ERRORS exec("{$cmd} 2>&1", $err); foreach($err as $errline){ echo $errline; } ?> Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639319 Share on other sites More sharing options...
shadysaiyan Posted September 12, 2008 Author Share Posted September 12, 2008 ^^ Thanks, that worked, now i can tweak it to make it my own Thanks! Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639450 Share on other sites More sharing options...
shadysaiyan Posted September 12, 2008 Author Share Posted September 12, 2008 Okay,so i tried changing it so it would be, made from a png image, and then what would animate is the text, so every second or -20 delay it would change text. <? //FULL PATH TO WHERE YOU WANT TO SAVE $path = "/home/content/s/h/a/shadysaiyan/html/"; $im = imagecreatefrompng("dnbar_1.png"); $white = ImageColorAllocate($im,255,255,255); $font = 'fonts/EuropeExt_Bold.ttf'; //THE COMMAND TO MAKE THE ANIMATION HAPPEN add more images if ya need to $cmd = "/usr/local/bin/convert -dispose none -delay 20 imagettftext({$im}, 12, 0, 5, 5, {$white}, {$font}, "shadysaiyan") -delay 20 imagettftext({$im}, 12, 0, 5, 5, {$white}, {$font}, "posts count: xxx") -loop{$path}/shadysaiyan.gif"; //EXECUTE THE COMMAND AND CAPTURE ANY ERRORS exec("{$cmd} 2>&1", $err); foreach($err as $errline){ echo $errline; } ?> <!--display the animated image--> <img src='shadysaiyan.gif'> I just get a broken image. the image doesnt generate. how would i tweak the path output there to make it generate? Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639475 Share on other sites More sharing options...
The Little Guy Posted September 12, 2008 Share Posted September 12, 2008 in your $path variable remove the last "/" What is this for? -delay 20 imagettftext({$im}, 12, 0, 5, 5, {$white}, {$font}, "posts count: xxx") -loop{$path}/shadysaiyan.gif"; doesn't it need to be in a variable, or be formatted better? Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639524 Share on other sites More sharing options...
shadysaiyan Posted September 12, 2008 Author Share Posted September 12, 2008 removed the "/" still doesnt generate. as for that part of code, i simply replaced the part when the image in the sequence would be, with text. cant seem to get it right though. Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639608 Share on other sites More sharing options...
shadysaiyan Posted September 12, 2008 Author Share Posted September 12, 2008 Sorry fro the double post again, but i've figured out how to go about this, first i have all the stats generated on their own individual images, then i make the animating code put them together into an animation. cant beliee i didnt think about it eirlier instead of tryin gto generate text onto nothing >_< thanks again! Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639622 Share on other sites More sharing options...
The Little Guy Posted September 12, 2008 Share Posted September 12, 2008 So... Did you get it? Topic Solved? Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-639967 Share on other sites More sharing options...
shadysaiyan Posted September 12, 2008 Author Share Posted September 12, 2008 Yes Solved Link to comment https://forums.phpfreaks.com/topic/123198-solved-making-a-dynamic-animated-gif/#findComment-640136 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.