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

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - constant cvs_version="$Id: graphic_text.pike,v 1.158 1999/03/23 22:24:54 mast Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.159 1999/05/17 06:47:10 neotron Exp $";   constant thread_safe=1;      #include <config.h>   #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0
Roxen.git/server/modules/graphics/graphic_text.pike:183:   {    if(last_image_name == f && last_image) return last_image->copy();    string data;    object file;    object img   #if !constant(Image.PNM)    =Image.image()   #endif    ;    +  if(id->misc->_load_image_called < 5) { +  // We were recursing very badly with the demo module here... +  id->misc->_load_image_called++;    if(!(data=roxen->try_get_file(fix_relative(f, id),id)))    if(!(file=open(f,"r")) || (!(data=file->read())))    return 0; -  +  } +  id->misc->_load_image_called = 0; +  if(!data) +  return 0;   //werror("Read "+strlen(data)+" bytes.\n");   #if constant(Image.GIF.decode)    catch { if(!img) img = Image.GIF.decode( data ); };   #endif   #if constant(Image.JPEG.decode)    catch { if(!img) img = Image.JPEG.decode( data ); };   #endif   #if constant(Image.PNG.decode)    catch { if(!img) img = Image.PNG.decode( data ); };   #endif