summary refs log tree commit diff
path: root/synapse/media
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-01-22 13:35:34 +0000
committerErik Johnston <erik@matrix.org>2015-01-22 13:35:34 +0000
commit7f058c5ff743e2cf563b9aa5436ee9801a14e633 (patch)
tree8ef0270ede93c304b0859c4e8fba49b9581b2514 /synapse/media
parentAdd twisted Service interface (diff)
parentMove experiments, graph and cmdclient into contrib (diff)
downloadsynapse-7f058c5ff743e2cf563b9aa5436ee9801a14e633.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj-perf
Conflicts:
	synapse/app/homeserver.py
Diffstat (limited to 'synapse/media')
-rw-r--r--synapse/media/v1/__init__.py6
-rw-r--r--synapse/media/v1/thumbnailer.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/synapse/media/v1/__init__.py b/synapse/media/v1/__init__.py
index 619999d268..d6c6690577 100644
--- a/synapse/media/v1/__init__.py
+++ b/synapse/media/v1/__init__.py
@@ -22,7 +22,8 @@ except IOError as e:
     if str(e).startswith("decoder jpeg not available"):
         raise Exception(
             "FATAL: jpeg codec not supported. Install pillow correctly! "
-            " 'sudo apt-get install libjpeg-dev' then 'pip install -I pillow'"
+            " 'sudo apt-get install libjpeg-dev' then 'pip uninstall pillow &&"
+            " pip install pillow --user'"
         )
 except Exception:
     # any other exception is fine
@@ -36,7 +37,8 @@ except IOError as e:
     if str(e).startswith("decoder zip not available"):
         raise Exception(
             "FATAL: zip codec not supported. Install pillow correctly! "
-            " 'sudo apt-get install libjpeg-dev' then 'pip install -I pillow'"
+            " 'sudo apt-get install libjpeg-dev' then 'pip uninstall pillow &&"
+            " pip install pillow --user'"
         )
 except Exception:
     # any other exception is fine
diff --git a/synapse/media/v1/thumbnailer.py b/synapse/media/v1/thumbnailer.py
index bc86efea8f..28404f2b7b 100644
--- a/synapse/media/v1/thumbnailer.py
+++ b/synapse/media/v1/thumbnailer.py
@@ -82,7 +82,7 @@ class Thumbnailer(object):
 
     def save_image(self, output_image, output_type, output_path):
         output_bytes_io = BytesIO()
-        output_image.save(output_bytes_io, self.FORMATS[output_type])
+        output_image.save(output_bytes_io, self.FORMATS[output_type], quality=70)
         output_bytes = output_bytes_io.getvalue()
         with open(output_path, "wb") as output_file:
             output_file.write(output_bytes)