Roxen.git / server / etc / modules / LazyImage.pmod / module.pmod

version» Context lines:

Roxen.git/server/etc/modules/LazyImage.pmod/module.pmod:825:    Layers|mapping process( Layers layers)    {    RequestID id = request_id->get();    if(!id)    error("Oops, no request id object.");       // Reject empty source paths for sufficiently high compat_level    if ((args->src || "") == "") {    float compat_level = (float) id->conf->query("compat_level");    if (compat_level >= 5.2) { -  if (RXML_CONTEXT) +     RXML.parse_error("Empty src attribute not allowed.\n"); -  else -  error("Empty src attribute not allowed."); +     }    }       array|mapping res; - #if constant(Sitebuilder) + #if constant(Sitebuilder) && constant(Sitebuilder.sb_start_use_imagecache)    // Let SiteBuilder get a chance to decode its argument data    if (Sitebuilder.sb_start_use_imagecache) {    Sitebuilder.sb_start_use_imagecache(args, id);    res = roxen.load_layers(args->src, id);    Sitebuilder.sb_end_use_imagecache(args, id);    } else   #endif    {    res = roxen.load_layers(args->src, id);    }    if( !res || mappingp(res) ) {    if (mappingp(res) && res->error == Protocols.HTTP.HTTP_UNAUTH)    return res; -  if (RXML_CONTEXT) -  // This can be called from within the gxml tag if -  // id->misc->generate_images is set. +     RXML.parse_error("Failed to load specified image [%O]\n", args->src ); -  else -  error("Failed to load specified image [%O]\n", args->src ); +     }    if( args->tiled )    foreach( res, Image.Layer l )    l->set_tiled( 1 );    return (layers||({}))+res;    }       Arguments check_args( Arguments args)    {    RequestID id = RXML.get_context()->id;
Roxen.git/server/etc/modules/LazyImage.pmod/module.pmod:880:    args->src = Roxen.fix_relative( args->src, id );    Stat s = id->conf->try_stat_file( args->src, id );       // try_stat_file() may fail although it is a valid image,    // e.g. /internal-roxen-*.    if (s)    {    string fn = id->conf->real_file( args->src, id );    if( fn ) Roxen.add_cache_stat_callback( id, fn, s[ST_MTIME] );    args->stat = s[ ST_MTIME ]; - #if constant(Sitebuilder) + #if constant(Sitebuilder) && constant(Sitebuilder.sb_prepare_imagecache)    // The file we called try_stat_file() on above may be a SiteBuilder    // file. If so we need to extend the argument data with e.g.    // current language fork.    if (Sitebuilder.sb_prepare_imagecache)    args = Sitebuilder.sb_prepare_imagecache(args, args->src, id);   #endif    }    return args;    }    };