Commit 7a2eec74 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

[remote] FileSystem: handle palette images correctly

parent 1c155f20
......@@ -660,14 +660,9 @@ class FileSystem(object):
path = self.expand(path)
if HAVE_PIL:
output = StringIO()
img = Image.open(path)
img = Image.open(path).convert('RGB')
img.thumbnail((width, height), Image.ANTIALIAS)
if sharpen:
try:
img.filter(ImageFilter.SHARPEN)
except ValueError as e:
if e.message == "cannot filter palette images":
pass
img.filter(ImageFilter.SHARPEN)
img.save(output, "JPEG")
contents = output.getvalue()
output.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment