Branch: Tag:

2001-03-01

2001-03-01 20:44:07 by Per Hedbor <ph@opera.com>

No backtrace if the image arguments is not OK in <emit source=cimg>

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

7:      roxen.ImageCache the_cache;    - constant cvs_version = "$Id: cimg.pike,v 1.36 2000/12/05 00:25:10 nilsson Exp $"; + constant cvs_version = "$Id: cimg.pike,v 1.37 2001/03/01 20:44:07 per Exp $";   constant module_type = MODULE_TAG;   constant module_name = "Image converter";   constant module_doc = "Provides the tag <tt>&lt;cimg&gt;</tt> that can be used "
201:    mapping a = get_my_args( check_args( args ), id );    string data;    -  res->src = (query_absolute_internal_location(id) + -  the_cache->store( a,id )); +  catch // This code will fail if the image does not exist. +  { +  res->src = (query_internal_location()+the_cache->store( a,id ));    data = the_cache->data( a, id , 0 );    res["file-size"] = strlen(data);    res["file-size-kb"] = strlen(data)/1024;    res["data"] = data;    res |= the_cache->metadata( a, id, 0 ); // enforce generation    return ({ res }); -  +  }; +  RXML.parse_error( "Illegal arguments or image" ); +  return ({});    }   }