diff --git a/mayan/apps/documents/api_views.py b/mayan/apps/documents/api_views.py index 49678e87b1..0d52a5deac 100644 --- a/mayan/apps/documents/api_views.py +++ b/mayan/apps/documents/api_views.py @@ -247,8 +247,8 @@ class APIDocumentPageImageView(generics.RetrieveAPIView): def retrieve(self, request, *args, **kwargs): size = request.GET.get('size') - zoom = request.GET.get('zoom') - rotation = request.GET.get('rotation') + zoom = int(request.GET.get('zoom')) + rotation = int(request.GET.get('rotation')) task = task_generate_document_page_image.apply_async( kwargs=dict( diff --git a/mayan/apps/documents/models.py b/mayan/apps/documents/models.py index 06f3afb64b..22797878ce 100644 --- a/mayan/apps/documents/models.py +++ b/mayan/apps/documents/models.py @@ -680,12 +680,10 @@ class DocumentPage(models.Model): # Convert arguments into transformations transformations = kwargs.get('transformations', []) size = kwargs.get('size', setting_display_size.value) - rotation = int( - kwargs.get('rotation', DEFAULT_ROTATION) or DEFAULT_ROTATION - ) % 360 - zoom_level = int( - kwargs.get('zoom', DEFAULT_ZOOM_LEVEL) or DEFAULT_ZOOM_LEVEL - ) + + rotation = kwargs.get('rotation', DEFAULT_ROTATION) + + zoom_level = kwargs.get('zoom', DEFAULT_ZOOM_LEVEL) if zoom_level < setting_zoom_min_level.value: zoom_level = setting_zoom_min_level.value diff --git a/mayan/apps/documents/widgets.py b/mayan/apps/documents/widgets.py index d996fde790..a0b7f9870d 100644 --- a/mayan/apps/documents/widgets.py +++ b/mayan/apps/documents/widgets.py @@ -98,8 +98,8 @@ def document_html_widget(document_page, click_view=None, click_view_arguments=No document = document_page.document query_dict = { - 'zoom': zoom, - 'rotation': rotation, + 'zoom': zoom or DEFAULT_ZOOM_LEVEL, + 'rotation': rotation or DEFAULT_ROTATION, 'size': size, 'page': document_page.page_number }