pike.git / lib / modules / _Image_XPM.pmod

version» Context lines:

pike.git/lib/modules/_Image_XPM.pmod:20:   {    array e;    array data;    mapping retopts = ([ ]);    if(!opts)    opts = ([]);    TI("Scan for header");    if(sscanf(what, "%*s/*%*[ \t]XPM%*[ \t]*/%*s{%s", what) != 5)    error("This is not a XPM image (1)\n");    -  if(strlen(what)<100000) +  if(sizeof(what)<100000)    {    TD("Extra scan for small images");    sscanf(what, "%s\n/* XPM */", what ) ||    sscanf(what, "%s\n/*\tXPM\t*/", what ) ||    sscanf(what, "%s\n/*\tXPM */", what )||    sscanf(what, "%s\n/* XPM */", what );       /* This is just a sanity check... */    what = reverse(what);    if(sscanf(what, "%*s}%s", what) != 2)
pike.git/lib/modules/_Image_XPM.pmod:165:    foreach(colors, string c)    res += "\""+c+"\",\n";    TD(sprintf("Encode %d rows", sizeof(rows)));       q = sizeof(rows);    foreach(rows, string row)    {    string r = "";    int i;    r += "\""; -  for(i=0; i<strlen(row); i++) +  for(i=0; i<sizeof(row); i++)    r += cmap_t[row[i]];    res += r+"\",\n";    }       TD(sprintf("Encoded %d rows", sizeof(rows)));    res = res+"};\n";    TE("Done");    return res;   }         object decode( string what )   {    return _decode(what)->image;   }