Folks ...
sorry forgot the breaks in the switch ...
it should be
int lazy_check(image_desc_t *im){
FILE *fd = NULL;
int size = 1;
struct stat gifstat;
if (im->lazy == 0) return 0; /* no lazy option */
if (stat(im->graphfile,&gifstat) != 0)
return 0; /* can't stat */
/* one pixel in the existing graph is more then what we would
change here ... */
if (time(NULL) - gifstat.st_mtime >
(im->end - im->start) / im->xsize)
return 0;
if ((fd = fopen(im->graphfile,"rb")) == NULL)
return 0; /* the file does not exist */
switch (im->imgformat) {
case IF_GIF:
size = GifSize(fd,&(im->xgif),&(im->ygif));
break;
case IF_PNG:
size = PngSize(fd,&(im->xgif),&(im->ygif));
break;
}
fclose(fd);
return size;
}
cheers
tobi
--
______ __ _
/_ __/_ / / (_) Oetiker, Timelord & SysMgr @ EE-Dept ETH-Zurich
/ // _ \/ _ \/ / TEL: +41(0)1-6325286 FAX:...1517 ICQ: 10419518
/_/ \.__/_.__/_/ [EMAIL PROTECTED] http://ee-staff.ethz.ch/~oetiker
--
Unsubscribe mailto:[EMAIL PROTECTED]
Help mailto:[EMAIL PROTECTED]
Archive http://www.ee.ethz.ch/~slist/rrd-developers