Branch: Tag:

2000-07-07

2000-07-07 10:49:24 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now checks the filesize before using the cache.
Thanks to Vincent Bumgarner <vbumgarn@uu.net>.

Rev: server/modules/graphics/cimg.pike:1.22

7:      roxen.ImageCache the_cache;    - constant cvs_version = "$Id: cimg.pike,v 1.21 2000/07/05 12:37:22 per Exp $"; + constant cvs_version = "$Id: cimg.pike,v 1.22 2000/07/07 10:49:24 grubba Exp $";   constant module_type = MODULE_PARSER;   constant module_name = "Image converter";   constant module_doc = "Provides the tag <tt>&lt;cimg&gt;</tt> that can be used "
123:    if( a->src )    catch    { -  a->stat = (id->conf->stat_file( a->src,id ) || -  file_stat( a->src ))[ ST_MTIME ]; +  array st = id->conf->stat_file(a->src, id) || file_stat(a->src); +  if (st) { +  a->mtime = (string) (a->stat = st[ST_MTIME]); +  a->filesize = (string) st[ST_SIZE]; +  }    };       a["background-color"] = id->misc->defines->bgcolor || "#eeeeee";