Ignore:
Timestamp:
Jan 10, 2005, 12:23:38 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • don't duplicate picture in filter functions.
  • removed OLE code; it doesn't work and won't be needed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/clubic.c

    r430 r445  
    1818#include "common.h"
    1919
    20 static struct image *find_glyphs(struct image *img);
     20static void find_glyphs(struct image *img);
    2121
    2222/* Our macros */
     
    2828char *decode_clubic(struct image *img)
    2929{
    30     struct image *tmp1, *tmp2;
     30    struct image *tmp;
    3131
    3232    if(!font)
     
    4646    strcpy(result, "      ");
    4747
    48     tmp1 = filter_equalize(img, 200);
    49     tmp2 = find_glyphs(tmp1);
     48    tmp = image_dup(img);
     49    filter_equalize(tmp, 200);
     50    find_glyphs(tmp);
    5051
    51     image_free(tmp1);
    52     image_free(tmp2);
     52    image_free(tmp);
    5353
    5454    return result;
    5555}
    5656
    57 static struct image *find_glyphs(struct image *img)
     57static void find_glyphs(struct image *img)
    5858{
    5959    char all[] = "0123456789";
     
    6464    }
    6565    glyphs[10];
    66     struct image *dst;
     66    struct image *tmp;
    6767    int x, y, i = 0;
    6868    int r, g, b;
     
    7070    int distmin, distx, disty, distch;
    7171
    72     dst = image_new(img->width, img->height);
     72    tmp = image_new(img->width, img->height);
    7373
    7474    for(y = 0; y < img->height; y++)
     
    7676        {
    7777            getpixel(img, x, y, &r, &g, &b);
    78             setpixel(dst, x, y, 255, g, 255);
     78            setpixel(tmp, x, y, 255, g, 255);
    7979        }
    8080
     
    169169                getpixel(font, xmin + x, ymin + y, &r, &g, &b);
    170170                if(r > 128) continue;
    171                 setpixel(dst, distx + x, disty + y, r, g, b);
     171                setpixel(tmp, distx + x, disty + y, r, g, b);
    172172            }
    173173
     
    176176    }
    177177
    178     return dst;
     178    image_free(tmp);
    179179}
    180180
Note: See TracChangeset for help on using the changeset viewer.