Changeset 445 for pwntcha/trunk/src/authimage.c
- Timestamp:
- Jan 10, 2005, 12:23:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pwntcha/trunk/src/authimage.c
r430 r445 27 27 char *all = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 28 28 char *result; 29 struct image *tmp 1, *tmp2, *tmp3;29 struct image *tmp; 30 30 int x, y, r, g, b, i; 31 31 … … 47 47 48 48 /* 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); 53 54 54 55 for(i = 0; i < 6; i++) … … 65 66 newx = 35.0 + (x + 6 * i) * 218.0 / 34.0 + y * 5.0 / 6.0 + 0.5; 66 67 newy = 33.0 - (x + 6 * i) * 18.0 / 34.0 + y * 42.0 / 6.0 + 0.5; 67 getpixel(tmp 3, newx, newy, &r, &g, &b);68 getpixel(tmp, newx, newy, &r, &g, &b); 68 69 getpixel(font, x + 6 * ch, y, &r2, &g, &b); 69 70 r = (r < 220) ? 0 : 255; … … 80 81 } 81 82 82 image_free(tmp3); 83 image_free(tmp2); 84 image_free(tmp1); 83 image_free(tmp); 85 84 86 85 return result;
Note: See TracChangeset
for help on using the changeset viewer.