Merge pull request #16 from EbookFoundation/dev-david
Added path setting for Tesseract. Removed printing in getContext func…pull/19/head
commit
8c2bc63bff
|
@ -516,7 +516,6 @@ class AltTextHTML(AltText):
|
|||
text = elem.text.strip()
|
||||
context[0] = text
|
||||
except:
|
||||
print("error 0")
|
||||
context[0] = None
|
||||
elem = tag
|
||||
text = ""
|
||||
|
@ -527,9 +526,7 @@ class AltTextHTML(AltText):
|
|||
text = elem.text.strip()
|
||||
context[1] = text
|
||||
except:
|
||||
print("error 1")
|
||||
context[1] = None
|
||||
print(context)
|
||||
return context
|
||||
|
||||
def genChars(self, imgData: bytes, src: str) -> str:
|
||||
|
|
|
@ -5,8 +5,9 @@ import pytesseract
|
|||
from .ocrengine import OCREngine
|
||||
|
||||
class Tesseract(OCREngine):
|
||||
def __init__(self) -> None:
|
||||
self.customPath = None
|
||||
def __init__(self, path:str = None) -> None:
|
||||
if (path != None):
|
||||
self._setTesseract(path)
|
||||
return None
|
||||
|
||||
def _setTesseract(self, path: str) -> bool:
|
||||
|
|
Loading…
Reference in New Issue