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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 11, 2008 Share Posted September 11, 2008 See this guide for debugging Quote Link to comment 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; } ?> Quote Link to comment 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! Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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! Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
shadysaiyan Posted September 12, 2008 Author Share Posted September 12, 2008 Yes Solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.