Ignore:
Timestamp:
Jan 10, 2005, 12:23:38 PM (18 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/authimage.c

    r430 r445  
    2727    char *all = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    2828    char *result;
    29     struct image *tmp1, *tmp2, *tmp3;
     29    struct image *tmp;
    3030    int x, y, r, g, b, i;
    3131
     
    4747
    4848    /* half the captchas are inverse video; we set them back to normal */
    49     tmp1 = filter_scale(img, 2.0);
    50     getpixel(img, 0, 0, &r, &g, &b);
    51     tmp2 = filter_equalize(tmp1, r * 3 / 4);
    52     tmp3 = filter_smooth(tmp2);
     49    tmp = image_dup(img);
     50    filter_scale(tmp, 2.0);
     51    getpixel(tmp, 0, 0, &r, &g, &b);
     52    filter_equalize(tmp, r * 3 / 4);
     53    filter_smooth(tmp);
    5354
    5455    for(i = 0; i < 6; i++)
     
    6566                    newx = 35.0 + (x + 6 * i) * 218.0 / 34.0 + y * 5.0 / 6.0 + 0.5;
    6667                    newy = 33.0 - (x + 6 * i) * 18.0 / 34.0 + y * 42.0 / 6.0 + 0.5;
    67                     getpixel(tmp3, newx, newy, &r, &g, &b);
     68                    getpixel(tmp, newx, newy, &r, &g, &b);
    6869                    getpixel(font, x + 6 * ch, y, &r2, &g, &b);
    6970                    r = (r < 220) ? 0 : 255;
     
    8081    }
    8182
    82     image_free(tmp3);
    83     image_free(tmp2);
    84     image_free(tmp1);
     83    image_free(tmp);
    8584
    8685    return result;
Note: See TracChangeset for help on using the changeset viewer.