Backport zoom transformation performance improvement, GitLab issue #334. Thanks to @startmat for the patch.

This commit is contained in:
Roberto Rosario
2016-11-08 02:03:10 -04:00
parent 43264f23b1
commit 4222035cc1
3 changed files with 11 additions and 1 deletions

View File

@@ -2,6 +2,8 @@
==================
- Backport resize transformation math operation fix (GitLab #319).
- Update Pillow to 3.1.2 (Security fix).
- Backport zoom transformation performance improvement (GitLab #334).
2.1.4 (2016-10-28)
==================

View File

@@ -12,11 +12,15 @@ This is a bug-fix release and all users are encouraged to upgrade.
Other changes
-------------
- Backport resize transformation math operation fix (GitLab #319).
- Update Pillow to 3.1.2
- https://pillow.readthedocs.io/en/3.4.x/releasenotes/3.1.1.html
- https://pillow.readthedocs.io/en/3.4.x/releasenotes/3.1.2.html
- Backport zoom performance improvement (GitLab #334).
Removals
--------
* None
@@ -70,6 +74,7 @@ Backward incompatible changes
Bugs fixed or issues closed
===========================
* `GitLab issue #311 <https://gitlab.com/mayan-edms/mayan-edms/issues/311>`_ acl page return ContentType:Document
* `GitLab issue #319 <https://gitlab.com/mayan-edms/mayan-edms/issues/319>`_ TransformationResize issue with very "long" image
* `GitLab issue #334 <https://gitlab.com/mayan-edms/mayan-edms/issues/334>`_ Perfomance improvment: prevent unnecessary image.resize in TransformationZoom
.. _PyPI: https://pypi.python.org/pypi/mayan-edms/

View File

@@ -309,6 +309,9 @@ class TransformationZoom(BaseTransformation):
def execute_on(self, *args, **kwargs):
super(TransformationZoom, self).execute_on(*args, **kwargs)
if self.percent == 100:
return self.image
decimal_value = float(self.percent) / 100
return self.image.resize(
(