diff --git a/document_preview/document_preview.py b/document_preview/document_preview.py index 9747667..319eccb 100644 --- a/document_preview/document_preview.py +++ b/document_preview/document_preview.py @@ -18,6 +18,7 @@ class DocumentPreview(ServiceBase): def __init__(self, config=None): super(DocumentPreview, self).__init__(config) self.has_internet_access = get_service_manifest().get('docker_config', {}).get('allow_internet_access', False) + self.log.info(f"Service is configured {'with' if self.has_internet_access else 'without'} internet access") def start(self): self.log.debug("Document preview service started") @@ -62,7 +63,7 @@ def render_documents(self, request: Request, max_pages=1): # Convert MSG to EML where applicable if request.file_type == 'document/office/email': with tempfile.NamedTemporaryFile() as tmp: - subprocess.run(['msgconvert', '-outfile', tmp.name, request.file_path]) + subprocess.run(['msgconvert', '-outfile', tmp.name, request.file_path], capture_output=True) tmp.seek(0) file_contents = tmp.read() # Render EML as PNG diff --git a/document_preview/helper/emlrender.py b/document_preview/helper/emlrender.py index 6aac20e..bf00c34 100644 --- a/document_preview/helper/emlrender.py +++ b/document_preview/helper/emlrender.py @@ -106,7 +106,7 @@ def processEml(data, output_dir, logger, load_ext_images=False, load_images=Fals imgkitOptions = {'load-error-handling': 'skip'} if not load_ext_images: - imgkitOptions.update({'no-images': None}) + imgkitOptions.update({'no-images': None, 'disable-javascript': None}) # imgkitOptions.update({ 'quiet': None }) imagesList = []