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

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