From 811a752efb20a5875a1c3d751e1d61c6cd03c2d5 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 15 Apr 2019 15:58:30 -0400 Subject: [PATCH] Remove converter base64 support Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ docs/releases/3.2.rst | 2 ++ mayan/apps/converter/classes.py | 8 ++------ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index e84bc41eae..d1ab79834f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -72,6 +72,8 @@ STATICFILES_STORAGE, TIME_ZONE, WSGI_APPLICATION. * Convert language choices into a function. * Move language choices generation to documents.utils. +* Remove support for generating documents images in base 64 + format. 3.1.11 (2019-04-XX) =================== diff --git a/docs/releases/3.2.rst b/docs/releases/3.2.rst index 71a77b8880..ed40babb73 100644 --- a/docs/releases/3.2.rst +++ b/docs/releases/3.2.rst @@ -104,6 +104,8 @@ Other changes STATICFILES_STORAGE, TIME_ZONE, WSGI_APPLICATION. * Convert language choices into a function. * Move language choices generation to documents.utils. +* Remove support for generating documents images in base 64 + format. Removals -------- diff --git a/mayan/apps/converter/classes.py b/mayan/apps/converter/classes.py index 5b0b98175e..978114988a 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 @@ -186,7 +185,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 yaml.load( stream=setting_graphics_backend_config.value, Loader=SafeLoader ).get( @@ -206,10 +205,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