diff --git a/HISTORY.rst b/HISTORY.rst index b3f6e54e11..f2154f6caf 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -100,6 +100,7 @@ - Fix carousel item height issues. - Add the "to=" keyword argument to all ForeignKey, ManayToMany and OneToOne Fields. - Add Makefile target to check the format of the README.rst file. +- Mark the feature to detect and fix the orientatin of PDF as experimental. 2.7.3 (2017-09-11) ================== diff --git a/docs/releases/3.0.rst b/docs/releases/3.0.rst index b830cb4abe..a370f2c35e 100644 --- a/docs/releases/3.0.rst +++ b/docs/releases/3.0.rst @@ -350,6 +350,11 @@ Page number summary The page number summary has been placed back at the bottom of the carousel pages in the document preview view. +Orientation detection +--------------------- +After reports that it is not working in 100% of the cases, the feature that +detects and fixes the orientation of PDF has been marked experimental and +now defaults to being disabled. Other changes worth mentioning ------------------------------ diff --git a/mayan/apps/documents/models.py b/mayan/apps/documents/models.py index cb34fc233f..f02dd43908 100644 --- a/mayan/apps/documents/models.py +++ b/mayan/apps/documents/models.py @@ -39,8 +39,8 @@ from .permissions import permission_document_view from .runtime import cache_storage_backend, storage_backend from .settings import ( setting_disable_base_image_cache, setting_disable_transformed_image_cache, - setting_display_width, setting_display_height, setting_language, - setting_zoom_max_level, setting_zoom_min_level + setting_display_width, setting_display_height, setting_fix_orientation, + setting_language, setting_zoom_max_level, setting_zoom_min_level ) from .signals import ( post_document_created, post_document_type_change, post_version_upload @@ -569,7 +569,8 @@ class DocumentVersion(models.Model): self.update_mimetype(save=False) self.save() self.update_page_count(save=False) - self.fix_orientation() + if setting_fix_orientation.value: + self.fix_orientation() logger.info( 'New document version "%s" created for document: %s', diff --git a/mayan/apps/documents/settings.py b/mayan/apps/documents/settings.py index 1dd5f01ace..21eb910b3c 100644 --- a/mayan/apps/documents/settings.py +++ b/mayan/apps/documents/settings.py @@ -101,3 +101,12 @@ setting_disable_transformed_image_cache = namespace.add_setting( 'of documents\' pages.' ) ) +setting_fix_orientation = namespace.add_setting( + global_name='DOCUMENTS_FIX_ORIENTATION', default=False, + help_text=_( + 'Detect the orientation of each of the document\'s pages ' + 'and create a corresponding rotation transformation to ' + 'display it rightside up. This is an experimental ' + 'feature and it is disabled by default.' + ) +)