summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-10-19 10:38:52 +0100
committerGitHub <noreply@github.com>2017-10-19 10:38:52 +0100
commitf4f65ef93e617a370582199c32e383ba1ad1e182 (patch)
tree57a8122a2195f71ab3ecab479e7e4d07e36036fb
parentFix typo (diff)
parentFix typo in thumbnail generation (diff)
downloadsynapse-f4f65ef93e617a370582199c32e383ba1ad1e182.tar.xz
Merge pull request #2557 from matrix-org/erikj/media_tumbnails
Fix typo in thumbnail generation
-rw-r--r--synapse/rest/media/v1/media_repository.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/media_repository.py b/synapse/rest/media/v1/media_repository.py
index 057c925b7b..6b50b45b1f 100644
--- a/synapse/rest/media/v1/media_repository.py
+++ b/synapse/rest/media/v1/media_repository.py
@@ -487,16 +487,19 @@ class MediaRepository(object):
                 )
 
             # Generate the thumbnail
-            if t_type == "crop":
+            if t_method == "crop":
                 t_byte_source = yield make_deferred_yieldable(threads.deferToThread(
                     thumbnailer.crop,
                     t_width, t_height, t_type,
                 ))
-            else:
+            elif t_method == "scale":
                 t_byte_source = yield make_deferred_yieldable(threads.deferToThread(
                     thumbnailer.scale,
                     t_width, t_height, t_type,
                 ))
+            else:
+                logger.error("Unrecognized method: %r", t_method)
+                continue
 
             if not t_byte_source:
                 continue