From 275ecd47f14ebee8309de1e1f13d090ca50c38fe Mon Sep 17 00:00:00 2001 From: Nitzo Date: Sun, 10 Jan 2016 02:12:35 +0200 Subject: "is" is evil (2) --- module/plugins/captcha/CircleCaptcha.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/captcha/CircleCaptcha.py') diff --git a/module/plugins/captcha/CircleCaptcha.py b/module/plugins/captcha/CircleCaptcha.py index 93bacae32..7df986b5e 100644 --- a/module/plugins/captcha/CircleCaptcha.py +++ b/module/plugins/captcha/CircleCaptcha.py @@ -31,7 +31,7 @@ class ImageSequence: class CircleCaptcha(OCR): __name__ = "CircleCaptcha" __type__ = "ocr" - __version__ = "1.07" + __version__ = "1.08" __status__ = "testing" __description__ = """Circle captcha ocr plugin""" @@ -138,7 +138,7 @@ class CircleCaptcha(OCR): jump = False continue - if (curpix < self.BACKGROUND and color == -1) or (curpix is color and color > -1): + if (curpix < self.BACKGROUND and color == -1) or (curpix == color and color > -1): if jump is False: #: Found pixel curcolor = curpix @@ -168,7 +168,7 @@ class CircleCaptcha(OCR): #: Found last pixel and the first white break - if (curpix < self.BACKGROUND and color == -1) or (curpix is color and color > -1): + if (curpix < self.BACKGROUND and color == -1) or (curpix == color and color > -1): #: Found pixel curcolor = curpix newx = x, curcolor @@ -199,7 +199,7 @@ class CircleCaptcha(OCR): #: Found last pixel and the first white break - if (curpix < self.BACKGROUND and color == -1) or (curpix is color and color > -1): + if (curpix < self.BACKGROUND and color == -1) or (curpix == color and color > -1): #: Found pixel curcolor = curpix newy = y, color @@ -521,7 +521,7 @@ class CircleCaptcha(OCR): return result curpix = pix[x, y] - if (curpix is color and color > -1) or (curpix < self.BACKGROUND and color == -1): + if (curpix == color and color > -1) or (curpix < self.BACKGROUND and color == -1): if curpix > self.BLACKCOLOR: result = 1 else: @@ -531,7 +531,7 @@ class CircleCaptcha(OCR): if exact is False: if x + 1 < im.size[0]: curpix = pix[x+1, y] - if (curpix is color and color > -1) or (curpix < self.BACKGROUND and color == -1): + if (curpix == color and color > -1) or (curpix < self.BACKGROUND and color == -1): if curpix > self.BLACKCOLOR: result = 1 if curpix <= self.BLACKCOLOR: @@ -539,7 +539,7 @@ class CircleCaptcha(OCR): if x > 0: curpix = pix[x-1, y] - if (curpix is color and color > -1) or (curpix < self.BACKGROUND and color == -1): + if (curpix == color and color > -1) or (curpix < self.BACKGROUND and color == -1): if curpix > self.BLACKCOLOR: result = 1 if curpix <= self.BLACKCOLOR: -- cgit v1.2.3