diff options
author | 2016-01-10 01:12:35 +0100 | |
---|---|---|
committer | 2016-01-10 01:12:35 +0100 | |
commit | 275ecd47f14ebee8309de1e1f13d090ca50c38fe (patch) | |
tree | f9c22e6fc16f376fcc6f34df9f86af3a300fbabe /module/plugins/captcha | |
parent | [ExternalScripts] Update (diff) | |
download | pyload-275ecd47f14ebee8309de1e1f13d090ca50c38fe.tar.xz |
"is" is evil (2)
Diffstat (limited to 'module/plugins/captcha')
-rw-r--r-- | module/plugins/captcha/CircleCaptcha.py | 14 | ||||
-rw-r--r-- | module/plugins/captcha/LinksaveIn.py | 6 |
2 files changed, 10 insertions, 10 deletions
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: diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index 34e32a208..2724af6c7 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -15,7 +15,7 @@ from module.plugins.internal.OCR import OCR class LinksaveIn(OCR): __name__ = "LinksaveIn" __type__ = "ocr" - __version__ = "0.16" + __version__ = "0.17" __status__ = "testing" __description__ = """Linksave.in ocr plugin""" @@ -83,7 +83,7 @@ class LinksaveIn(OCR): except Exception: cstat[rgb_c] = 1 - if rgb_bg is rgb_c: + if rgb_bg == rgb_c: stat[bgpath] += 1 max_p = 0 bg = "" @@ -113,7 +113,7 @@ class LinksaveIn(OCR): for y in xrange(bg.size[1]): rgb_bg = bglut[bgpix[x, y]] rgb_c = lut[pix[x, y]] - if rgb_c is rgb_bg: + if rgb_c == rgb_bg: orgpix[x, y] = (255, 255, 255) |