Roxen.git / server / modules / graphics / cimg.pike

version» Context lines:

Roxen.git/server/modules/graphics/cimg.pike:1:   // This is a roxen module. Copyright © 1999 - 2004, Roxen IS.   //      #include <module.h>   inherit "module";   constant thread_safe=1;      roxen.ImageCache the_cache;    - constant cvs_version = "$Id: cimg.pike,v 1.77 2008/10/29 10:58:08 erikd Exp $"; + constant cvs_version = "$Id: cimg.pike,v 1.78 2008/12/17 07:10:55 tomas Exp $";   constant module_type = MODULE_TAG;   constant module_name = "Graphics: Image converter";   constant module_doc = "Provides the tag <tt>&lt;cimg&gt;</tt> that can be used "   "to convert images between different image formats.";         mapping tagdocumentation()   {    Stdio.File file=Stdio.File();    if(!file->open(__FILE__,"r")) return 0;
Roxen.git/server/modules/graphics/cimg.pike:386:    // disable protocol cache.    int cacheable = id->misc->cacheable;    int no_proto_cache = id->misc->no_proto_cache;   #ifdef DEBUG_CACHEABLE    report_debug("%s:%d saved cacheable flags\n", __FILE__, __LINE__);   #endif    res->src=(query_absolute_internal_location(id)+the_cache->store( a,id ));    if(args->filename && sizeof(args->filename))    res->src += "/" + Roxen.http_encode_url(args->filename);    if(do_ext) -  res->src += "." + (a->format || "gif"); +  res->src += "." + a->format;    data = the_cache->data( a, id , 0 );    res["file-size"] = strlen(data);    res["file-size-kb"] = strlen(data)/1024;    if (lower_case(args->nodata || "no") == "no")    res["data"] = data;    res |= the_cache->metadata( a, id, 0 ); // enforce generation   #ifdef DEBUG_CACHEABLE    report_debug("%s:%d restored cacheable flags\n", __FILE__, __LINE__);   #endif    id->misc->cacheable = cacheable;
Roxen.git/server/modules/graphics/cimg.pike:428:       array do_return(RequestID id)    {    mapping a = get_my_args( check_args( args ), id );    args -= a;    string ext = "";    string filename = "";    if(args->filename && sizeof(args->filename))    filename += "/" + Roxen.http_encode_url(m_delete(args, "filename"));    if(do_ext) -  ext = "." + (a->format || "gif"); +  ext = "." + a->format;    args->src = query_absolute_internal_location( id )    + the_cache->store( a, id ) + filename + ext;    int no_draw = !id->misc->generate_images;    if( mapping size = the_cache->metadata( a, id, no_draw ) )    {    // image in cache (no_draw above prevents generation on-the-fly)    args->width = size->xsize;    args->height = size->ysize;    }    int xml=!args->noxml;
Roxen.git/server/modules/graphics/cimg.pike:458:    constant name = "cimg-url";    constant flags = RXML.FLAG_EMPTY_ELEMENT;       class Frame    {    inherit RXML.Frame;       array do_return(RequestID id)    {    string filename = ""; -  if(args->filename && sizeof(args->filename)) -  filename = "/" + Roxen.http_encode_url(m_delete(args, "filename")); +  mapping a = get_my_args (check_args (args), id); +  +  if(a->filename && sizeof(a->filename)) +  filename = "/" + Roxen.http_encode_url(m_delete(a, "filename"));    result = query_absolute_internal_location(id) -  + the_cache->store(get_my_args(check_args( args ), id ), id) +  + the_cache->store(a, id)    + filename -  + (do_ext ? "." + (args->format || "gif") : ""); +  + (do_ext ? "." + a->format : "");    return 0;    }    }   }