Branch: Tag:

2002-11-16

2002-11-16 10:41:32 by Marcus Agehall <agehall@gmail.com>

Changed defaults to use PNG instead of GIF. If PNG is used, true-alpha
will be used unless true-alpha='0' is specified.

Rev: server/modules/graphics/graphic_text.pike:1.295

1:   // This is a ChiliMoon module. Copyright © 1996 - 2001, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.294 2002/11/11 01:53:34 mani Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.295 2002/11/16 10:41:32 agehall Exp $";      #include <module.h>   inherit "module";
745:    ([    "xsize":data[1][0],    "ysize":data[1][1], -  "type":(args->format?id->conf->type_from_filename("x."+args->format):"image/gif"), +  "type":(args->format?id->conf->type_from_filename("x."+args->format):"image/png"),    ])    ]);   }
856:    m_delete(arg,"width");    m_delete(arg,"height");    +  // Make format selection explicit since fallback may vary depending on +  // encoders present in this installation. +  if (!arg->format) +  arg->format = "png"; +    #if !constant(Image.GIF) || !constant(Image.GIF.encode)    // fadein or scroll not supported without GIF    m_delete(arg, "fadein");    m_delete(arg, "scroll"); - #endif -  -  // Make format selection explicit since fallback may vary depending on -  // encoders present in this installation. -  if (!arg->format) - #if constant(Image.GIF) && constant(Image.GIF.encode) -  arg->format = "gif"; +    #else -  arg->format = "jpg"; +  // These features requires the format to be GIF. +  if (arg->format != "gif") { +  m_delete(arg, "fadein"); +  m_delete(arg, "scroll"); +  }   #endif    -  foreach(filearg, string tmp) -  if(arg[tmp]) -  { -  p[tmp]=Roxen.fix_relative(arg[tmp],id); +  if ( arg->format == "png" && !arg["true-alpha"] ) { +  // Everyone wants truealpha if using PNG! +  arg["true-alpha"]=1; +  } +  +  foreach(arg & filearg; string index; string value) { +  p[index]=Roxen.fix_relative(value,id);    m_delete(arg,tmp);    }    - // if(arg->border && has_value(arg->border,",")) - // { - // p->border=arg->border; - // m_delete(arg,"border"); - // } -  +     array i = indices( arg );    foreach(textarg, string tmp)    foreach( glob( tmp, i ), string a )