From 040bdd1b03d0e3b6a710e62f556cb77dd9f273e6 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 19 May 2014 23:15:37 +0200 Subject: [PATCH] P as jpg --- oml/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oml/utils.py b/oml/utils.py index 3acbad4..07c6d7b 100644 --- a/oml/utils.py +++ b/oml/utils.py @@ -45,7 +45,9 @@ def get_by_id(objects, id): return get_by_key(objects, 'id', id) def resize_image(data, width=None, size=None): - source = Image.open(StringIO(data)) #.convert('RGB') + source = Image.open(StringIO(data)) + if source.mode == 'P': + source = source.convert('RGB') source_width = source.size[0] source_height = source.size[1] if size: