Page 1 of 1
PHP & Gif - Gif not animated now :(
Posted: Fri Aug 05, 2005 5:56 am
by Dale
Code: Select all
<?php
header("Content-type: image/gif");
$im = imagecreatefromgif("./bannerads/banner1.gif");
imagegif($im);
imagedestroy($im);
?>
I'm using this code above to show a GIF on a website, however that GIF is animated, howver when using the script above its not animated, is there a way to get around this?
Posted: Fri Aug 05, 2005 5:58 am
by shiznatix
...why not just show the gif with html instead of making a new gif out of a gif?
Posted: Fri Aug 05, 2005 5:59 am
by Dale
Because i want the GIF's to be configured in a database, like what ones are shown on each page, and i cannot be bothered to rename every .HTM file to a .PHP, as i would also have to update every link on each page too.
Posted: Fri Aug 05, 2005 6:12 am
by shiznatix
after a quick google search i came up with that it is best to use your gd library with imagequick which can make animated gifs but i think this would probebly be the most difficult way to go about doing this.
i am sure that there is a easier way to do this than the way you are doing it because already you are renaming the files to .php to show the new gif are you not? there has to be somthing i am missing becuase making a gif from a gif without changing anything seams like a very unnecciary way of doing things
Posted: Fri Aug 05, 2005 6:18 am
by Dale
shiznatix wrote:i am sure that there is a easier way to do this than the way you are doing it because already you are renaming the files to .php to show the new gif are you not?
Nah, im keeping them .HTM, and just using the image tag liek so:
So then instead of changing the code on each page, i can just update it from 1 central control panel, also monitor how many clicks, ect..
Posted: Fri Aug 05, 2005 8:37 am
by feyd
you can just supply the image file directly to the browser without futzing with image controls...
readfile()