source: pwntcha/trunk/src/test.c @ 1000

Last change on this file since 1000 was 482, checked in by Sam Hocevar, 15 years ago
  • filter_equalize -> filter_threshold
  • Property svn:keywords set to Id
File size: 908 bytes
Line 
1/*
2 * test.c: test captchas
3 * $Id: test.c 482 2005-05-30 15:22:02Z sam $
4 *
5 * Copyright: (c) 2004 Sam Hocevar <sam@zoy.org>
6 *   This program is free software; you can redistribute it and/or
7 *   modify it under the terms of the Do What The Fuck You Want To
8 *   Public License as published by Banlu Kemiyatorn. See
9 *   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
10 */
11
12#include <stdio.h>
13#include <stdlib.h>
14#include <string.h>
15#include <limits.h>
16#include <math.h>
17
18#include "config.h"
19#include "common.h"
20
21/* Main function */
22char *decode_test(struct image *img)
23{
24    char *result;
25    struct image *tmp;
26
27    /* phpBB captchas have 6 characters */
28    result = malloc(7 * sizeof(char));
29    result[0] = 0;
30
31    tmp = image_dup(img);
32    filter_smooth(tmp);
33    filter_median(tmp);
34    filter_threshold(tmp, 130);
35    filter_median(tmp);
36
37    image_free(tmp);
38
39    return result;
40}
41
42/* The following functions are local */
43
Note: See TracBrowser for help on using the repository browser.