From e1e82a8c93b667ac9dd35a6dd34cb30e26545798 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 18 Jul 2018 09:23:23 +0200 Subject: Fix writing thumbnails from transparent images JPEG does not support alpha channels, so remove RGBA from the list of valid modes. --- fbin/fbin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fbin') diff --git a/fbin/fbin.py b/fbin/fbin.py index 7a97194..ffc6a5b 100755 --- a/fbin/fbin.py +++ b/fbin/fbin.py @@ -370,7 +370,7 @@ def thumb(hash): # We can't generate a thumbnail for this file, just say it doesn't exist. abort(404) # Check for valid JPEG modes. - if im.mode not in ('1', 'L', 'RGB', 'RGBA', 'RGBX', 'CMYK', 'YCbCr'): + if im.mode not in ('1', 'L', 'RGB', 'RGBX', 'CMYK', 'YCbCr'): im = im.convert('RGB') im.thumbnail(current_app.config.get('THUMB_SIZE', (128, 128)), Image.ANTIALIAS) im.save(thumbfile) -- cgit v1.2.3