From f43b020d94490728c896f8f47dc0fb07aeef5d79 Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Wed, 18 Apr 2018 14:06:51 +1000 Subject: [PATCH] resizer: Convert to RGB colourspace when saving. --- tornado_gallery/resizer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tornado_gallery/resizer.py b/tornado_gallery/resizer.py index 4b02472..0c47a60 100644 --- a/tornado_gallery/resizer.py +++ b/tornado_gallery/resizer.py @@ -200,6 +200,9 @@ class ResizerPool(object): # Resize! img = img.resize((width, height), Image.LANCZOS) + # Convert to RGB colourspace + img = img.convert('RGB') + # Write out the new file. img.save(open(cache_path,'wb'), img_format.pil_fmt)