From 27c04ed9be4a7a213e47dd4af32bb4c2f5f09b2f Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 5 Dec 2018 14:45:20 -0400 Subject: [PATCH] Converter: Remove base64 image support The get_page method had support to return the image in base64 format. This feature is no longer used by any other app. Signed-off-by: Roberto Rosario --- mayan/apps/converter/classes.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mayan/apps/converter/classes.py b/mayan/apps/converter/classes.py index 58cf5d3102..2974145136 100644 --- a/mayan/apps/converter/classes.py +++ b/mayan/apps/converter/classes.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import base64 from io import BytesIO import logging import os @@ -178,7 +177,7 @@ class ConverterBase(object): fs_cleanup(input_filepath) fs_cleanup(converted_output) - def get_page(self, output_format=None, as_base64=False): + def get_page(self, output_format=None): output_format = output_format or setting_graphics_backend_arguments.value.get( 'pillow_format', DEFAULT_PILLOW_FORMAT ) @@ -196,10 +195,7 @@ class ConverterBase(object): self.image.convert(new_mode).save(image_buffer, format=output_format) - if as_base64: - return 'data:{};base64,{}'.format(Image.MIME[output_format], base64.b64encode(image_buffer.getvalue())) - else: - image_buffer.seek(0) + image_buffer.seek(0) return image_buffer