summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/OCR.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-24 06:55:49 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-24 06:55:49 +0200
commit94d017cd2a5c1f194960827a8c7e46afc3682008 (patch)
treee06f2d20d6c4cfa2cefb446c3b266cc3c1aa4e69 /module/plugins/internal/OCR.py
parentHotfixes (diff)
downloadpyload-94d017cd2a5c1f194960827a8c7e46afc3682008.tar.xz
Hotfixes (2)
Diffstat (limited to 'module/plugins/internal/OCR.py')
-rw-r--r--module/plugins/internal/OCR.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py
index 13089c9c0..064bf1d7d 100644
--- a/module/plugins/internal/OCR.py
+++ b/module/plugins/internal/OCR.py
@@ -22,7 +22,7 @@ class OCR(Plugin):
__name__ = "OCR"
__type__ = "ocr"
__version__ = "0.13"
- __status__ = "stable"
+ __status__ = "testing"
__description__ = """OCR base plugin"""
__license__ = "GPLv3"
@@ -88,7 +88,7 @@ class OCR(Plugin):
self.pyload.log_debug("Saving tiff...")
self.image.save(tmpTif.name, 'TIFF')
- if os.name == "nt":
+ if os.name is "nt":
tessparams = [os.path.join(pypath, "tesseract", "tesseract.exe")]
else:
tessparams = ["tesseract"]
@@ -165,7 +165,7 @@ class OCR(Plugin):
for x in xrange(w):
for y in xrange(h):
- if pixels[x, y] == 255:
+ if pixels[x, y] is 255:
continue
#: No point in processing white pixels since we only want to remove black pixel
count = 0
@@ -198,7 +198,7 @@ class OCR(Plugin):
#: Second pass: this time set all 1's to 255 (white)
for x in xrange(w):
for y in xrange(h):
- if pixels[x, y] == 1:
+ if pixels[x, y] is 1:
pixels[x, y] = 255
self.pixels = pixels
@@ -213,7 +213,7 @@ class OCR(Plugin):
for x in xrange(w):
for y in xrange(h):
- if pixels[x, y] == 0:
+ if pixels[x, y] is 0:
pixels[x, y] = 155
highest = {}
@@ -229,7 +229,7 @@ class OCR(Plugin):
for x in xrange(w):
for y in xrange(h):
- if pixels[x, y] == 0:
+ if pixels[x, y] is 0:
pixels[x, y] = 255
count = {}
@@ -237,7 +237,7 @@ class OCR(Plugin):
for x in xrange(w):
count[x] = 0
for y in xrange(h):
- if pixels[x, y] == 155:
+ if pixels[x, y] is 155:
count[x] += 1
sum = 0
@@ -270,10 +270,10 @@ class OCR(Plugin):
for x in xrange(w):
for y in xrange(h):
- if pixels[x, y] == 0:
+ if pixels[x, y] is 0:
pixels[x, y] = 255
- if pixels[x, y] == 155:
+ if pixels[x, y] is 155:
pixels[x, y] = 0
self.pixels = pixels
@@ -327,7 +327,7 @@ class OCR(Plugin):
for key, item in values.iteritems():
- if key.__class__ == str:
+ if key.__class__ is str:
result = result.replace(key, item)
else:
for expr in key: