summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/OCR.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-08 03:08:17 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-08 03:08:17 +0200
commit035d8c554c9e24206f9dc6f76e17fbe9e4c3607f (patch)
tree3b173d98512f33233d4aeb2906493d3abeea2369 /module/plugins/internal/OCR.py
parentMerge pull request #1957 from GammaC0de/patch-3 (diff)
downloadpyload-035d8c554c9e24206f9dc6f76e17fbe9e4c3607f.tar.xz
Fixpack (4)
Diffstat (limited to 'module/plugins/internal/OCR.py')
-rw-r--r--module/plugins/internal/OCR.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py
index 884639b6b..333082425 100644
--- a/module/plugins/internal/OCR.py
+++ b/module/plugins/internal/OCR.py
@@ -20,7 +20,7 @@ from module.utils import save_join as fs_join
class OCR(Plugin):
__name__ = "OCR"
__type__ = "ocr"
- __version__ = "0.19"
+ __version__ = "0.20"
__status__ = "testing"
__description__ = """OCR base plugin"""
@@ -88,7 +88,7 @@ class OCR(Plugin):
tmpTxt.close()
except IOError, e:
- self.log_error(e)
+ self.log_error(e, trace=True)
return
self.pyload.log_debug("Saving tiff...")
@@ -139,7 +139,7 @@ class OCR(Plugin):
os.remove(tmpSub.name)
except OSError, e:
- self.log_warning(e)
+ self.log_warning(e, trace=True)
def recognize(self, name):
@@ -179,18 +179,25 @@ class OCR(Plugin):
try:
if pixels[x - 1, y - 1] != 255:
count += 1
+
if pixels[x - 1, y] != 255:
count += 1
+
if pixels[x - 1, y + 1] != 255:
count += 1
+
if pixels[x, y + 1] != 255:
count += 1
+
if pixels[x + 1, y + 1] != 255:
count += 1
+
if pixels[x + 1, y] != 255:
count += 1
+
if pixels[x + 1, y - 1] != 255:
count += 1
+
if pixels[x, y - 1] != 255:
count += 1