all repos — captcha @ 5192a0664066c8eec853787f8036415a4ae8ebd4

Go package captcha implements generation and verification of image and audio CAPTCHAs.

image: remove random variations in drawDigit's x,y.

For the standard size and width with new font they no longer had any
effect anyway (were always +0).
Dmitry Chestnykh dmitry@codingrobots.com
Wed, 27 Apr 2011 23:37:21 +0200
commit

5192a0664066c8eec853787f8036415a4ae8ebd4

parent

de409bf982a0804a3f85bd07a9a6f16e1c98bbff

1 files changed, 3 insertions(+), 5 deletions(-)

jump to
M image.goimage.go

@@ -14,7 +14,7 @@ const (

// Standard width and height of a captcha image. StdWidth = 240 StdHeight = 80 - + // Maximum absolute skew factor of a single digit. maxSkew = 0.7 )

@@ -181,10 +181,8 @@ for xx := 0; xx < fontWidth; xx++ {

if digit[yy*fontWidth+xx] != blackChar { continue } - // Introduce random variations. - ox := x + (xx * img.dotSize) + rnd(0, r/2) - oy := y + (yy * img.dotSize) + rnd(0, r/2) - + ox := x + xx*img.dotSize + oy := y + yy*img.dotSize img.drawCircle(img.primaryColor, ox, oy, r) } xs += skf