summary refs log tree commit diff
path: root/synapse/rest/media
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2017-03-01 17:20:37 +0000
committerDavid Baker <dave@matrix.org>2017-03-01 17:20:37 +0000
commit3557cf34dc011211db1b80016ce09ada86b41ffc (patch)
tree9ff6c82f81d7a932ffc1d66d677a5cfa65157494 /synapse/rest/media
parentWIP support for msisdn 3pid proxy methods (diff)
parentkick jenkins (diff)
downloadsynapse-3557cf34dc011211db1b80016ce09ada86b41ffc.tar.xz
Merge remote-tracking branch 'origin/develop' into dbkr/msisdn_signin
Diffstat (limited to 'synapse/rest/media')
-rw-r--r--synapse/rest/media/v1/media_repository.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/media_repository.py b/synapse/rest/media/v1/media_repository.py
index 3cbeca503c..481ffee200 100644
--- a/synapse/rest/media/v1/media_repository.py
+++ b/synapse/rest/media/v1/media_repository.py
@@ -240,6 +240,9 @@ class MediaRepository(object):
         if t_method == "crop":
             t_len = thumbnailer.crop(t_path, t_width, t_height, t_type)
         elif t_method == "scale":
+            t_width, t_height = thumbnailer.aspect(t_width, t_height)
+            t_width = min(m_width, t_width)
+            t_height = min(m_height, t_height)
             t_len = thumbnailer.scale(t_path, t_width, t_height, t_type)
         else:
             t_len = None