Help finding the best approach in displaying an image that a script generates
I'm still new at php and could use a little guiadence. I trying to put together a php or html page. The page will have three frames and one fram is gif that updates every 2-3 minutes. I've put a little script to dump a gif locally on the server and then I was planning on calling the gif. The problem I'm running into is that the script takes a little time to generate the gif and when it goes and grab the gif its an out-dated one. So, I'm behind every time I refresh the page. Should I just shoot the gif onto the page and not save it directly? If so, how? Below is the script I have.
Many thanks in advance!!
resize("./", "http://images.wsdot.wa.gov/nwflow/flowmaps/sysvert.gif", "538", "./");
function resize($cur_dir, $cur_file, $newwidth, $output_dir)
$dir_name = $cur_dir;
$olddir = getcwd();
$dir = opendir($dir_name);
$filename = $cur_file;
$format = 'image/jpeg';
if (preg_match("/.gif/i", "$filename"))
$format = 'image/gif';
$format = 'image/png';
list($width, $height) = getimagesize($filename);
$source = imagecreatefromjpeg($filename);
$source = imagecreatefromgif($filename);
$source = imagecreatefrompng($filename);
$dimg = imagecreatetruecolor(640,538);
$source = @imagecreatefromgif("$filename");
imagecopyresized($dimg, $source, 0,0,0,438, $newwidth, $newheight, $width, $height);
|All times are GMT. The time now is 11:14 AM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0