Load the converter class on demand

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-02-01 04:20:47 -04:00
parent 5b6a6bccb2
commit 4376d76c8a
4 changed files with 14 additions and 11 deletions

View File

@@ -13,7 +13,8 @@ from django.urls import reverse
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.six.moves.urllib.parse import quote_plus, unquote_plus
from mayan.apps.converter import TransformationResize, converter_class
from mayan.apps.converter import TransformationResize
from mayan.apps.converter.utils import get_converter_class
from .storages import storage_staging_file_image_cache
@@ -143,7 +144,7 @@ class StagingFile(object):
try:
file_object = open(self.get_full_path(), mode='rb')
converter = converter_class(file_object=file_object)
converter = get_converter_class()(file_object=file_object)
page_image = converter.get_page()