PIL Image.save() requires a string parameter [1] while under python3 we call it with bytes.
This leads to wrong format detection (b'.png' isn't a key in supported formats list).

[1] https://pillow.readthedocs.io/en/latest/reference/Image.html#PIL.Image.Image.save
This commit is contained in:
Laurent Kislaire 2018-09-09 21:51:10 +02:00
parent 3ddf3ef58a
commit 1bada74bef

View file

@ -72,7 +72,7 @@ def pil_resize(maxwidth, path_in, path_out=None):
im = Image.open(util.syspath(path_in))
size = maxwidth, maxwidth
im.thumbnail(size, Image.ANTIALIAS)
im.save(path_out)
im.save(util.displayable_path(path_out))
return path_out
except IOError:
log.error(u"PIL cannot create thumbnail for '{0}'",