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 - 2001, Roxen IS. + // This is a ChiliMoon module. Copyright © 1999 - 2001, Roxen IS.   //      #include <module.h>   inherit "module";   constant thread_safe=1;      roxen.ImageCache the_cache;    - constant cvs_version = "$Id: cimg.pike,v 1.53 2002/11/07 15:57:16 mani Exp $"; + constant cvs_version = "$Id: cimg.pike,v 1.54 2002/11/17 17:55:44 mani 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;    mapping doc = compile_string("#define manual\n"+file->read())->tagdoc;    foreach(({ "cimg", "cimg-url" }), string tag)    doc[tag] += the_cache->documentation(tag + -  " src='/internal-roxen-testimage'"); +  " src='/%01/testimage'");    return doc;   }      #ifdef manual   constant tagdoc=(["cimg":#"<desc tag='tag'><p><short>    Manipulates and converts images between different image    formats.</short> Provides the tag <tag>cimg</tag> that makes it is    possible to convert, resize, crop and in other ways transform    images.</p>   </desc>      <attr name='src' value='url' required='required'><p>    The path to the indata file.</p>    - <ex><cimg src='/internal-roxen-testimage'/></ex> + <ex><cimg src='/%01/testimage'/></ex>   </attr>      <attr name='data' value='imagedata'><p>    Insert images from other sources, e.g. databases through entities or    variables.</p>   <ex-box><emit source='sql' query='select imagedata from images where id=37'>   <cimg data='&sql.imagedata;'/>   </emit></ex-box>   </attr>",   
Roxen.git/server/modules/graphics/cimg.pike:51: Inside #if defined(manual)
   This tag generates an URL to the manipulated picture.</short>    <tag>cimg-url</tag> takes the same attributes as <xref    href='cimg.tag' />, including the image cache attributes. The use for    the tag is to insert image-URLs into various places, e.g. a    submit-box.</p>   </desc>      <attr name='src' value='url' required='required'><p>    The path to the indata file.</p>    - <ex><cimg-url src='/internal-roxen-testimage'/></ex> + <ex><cimg-url src='/%01/testimage'/></ex>   </attr>      <attr name='data' value='imagedata'><p>    Insert images from other sources, e.g. databases through entities or    variables.</p>   <ex-box><emit source='sql' query='select imagedata from images where id=37'>    <cimg-url data='&sql.imagedata;'/>   </emit></ex-box>   </attr>",   
Roxen.git/server/modules/graphics/cimg.pike:130:   }      void flush_cache() {    the_cache->flush();   }      string status() {    array s=the_cache->status();    return sprintf("<b>Images in cache:</b> %d images<br />\n"    "<b>Cache size:</b> %s", -  s[0], Roxen.sizetostring(s[1])); +  s[0], String.int2size(s[1]));   }      array(Image.Layer)|mapping generate_image( mapping args, RequestID id )   {    array layers;    mapping opts = ([]);    if( args["process-all-layers"] )    opts->draw_all_layers = 1;       if( args["jpeg-shrink" ] )