summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-10-13 13:47:38 +0100
committerErik Johnston <erik@matrix.org>2017-10-13 13:47:38 +0100
commit31aa7bd8d1748548b2523f58b348bb6787dcc019 (patch)
tree1755ce0565a947f833b5adc99ad91dfb05fd9fee /synapse/rest
parentComment (diff)
downloadsynapse-31aa7bd8d1748548b2523f58b348bb6787dcc019.tar.xz
Move type into key
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/media/v1/media_repository.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/rest/media/v1/media_repository.py b/synapse/rest/media/v1/media_repository.py
index 700fd0dd24..dee834389f 100644
--- a/synapse/rest/media/v1/media_repository.py
+++ b/synapse/rest/media/v1/media_repository.py
@@ -468,15 +468,15 @@ class MediaRepository(object):
         thumbnails = {}
         for r_width, r_height, r_method, r_type in requirements:
             if r_method == "crop":
-                thumbnails.setdefault((r_width, r_height), (r_method, r_type))
+                thumbnails.setdefault((r_width, r_height,r_type), r_method)
             elif r_method == "scale":
                 t_width, t_height = thumbnailer.aspect(r_width, r_height)
                 t_width = min(m_width, t_width)
                 t_height = min(m_height, t_height)
-                thumbnails[(t_width, t_height)] = (r_method, r_type)
+                thumbnails[(t_width, t_height, r_type)] = r_method
 
         # Now we generate the thumbnails for each dimension, store it
-        for (t_width, t_height), (t_method, t_type) in thumbnails.iteritems():
+        for (t_width, t_height, t_type), t_method in thumbnails.iteritems():
             # Generate the thumbnail
             if t_type == "crop":
                 t_byte_source = yield make_deferred_yieldable(threads.deferToThread(