Initial commit of the redactions app
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
28
mayan/apps/redactions/classes.py
Normal file
28
mayan/apps/redactions/classes.py
Normal file
@@ -0,0 +1,28 @@
|
||||
'''
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from converter import converter_class
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class OCRBackendBase(object):
|
||||
def execute(self, file_object, language=None, process_barcodes=True, process_text=True, transformations=None):
|
||||
self.language = language
|
||||
self.process_barcodes = process_barcodes
|
||||
self.process_text = process_text
|
||||
|
||||
if not transformations:
|
||||
transformations = []
|
||||
|
||||
self.converter = converter_class(file_object=file_object)
|
||||
|
||||
for transformation in transformations:
|
||||
self.converter.transform(transformation=transformation)
|
||||
|
||||
self.image = Image.open(self.converter.get_page())
|
||||
'''
|
||||
Reference in New Issue
Block a user