This commit is contained in:
j 2014-05-19 23:15:37 +02:00
parent 996a754db5
commit 040bdd1b03
1 changed files with 3 additions and 1 deletions

View File

@ -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: