changeset b092e76193d8 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=b092e76193d8
description:
Use new image returned by PIL.Image methods
issue10703
review350531006
diffstat:
trytond/ir/avatar.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (19 lines):
diff -r 62d7d2651fa1 -r b092e76193d8 trytond/ir/avatar.py
--- a/trytond/ir/avatar.py Sat Sep 04 19:46:04 2021 +0200
+++ b/trytond/ir/avatar.py Sun Sep 05 14:40:15 2021 +0200
@@ -110,13 +110,13 @@
img = Image.open(io.BytesIO(image))
width, height = img.size
size = min(width, height)
- img.crop((
+ img = img.crop((
(width - size) // 2,
(height - size) // 2,
(width + size) // 2,
(height + size) // 2))
if size > 2048:
- img.resize((2048, 2048))
+ img = img.resize((2048, 2048))
if img.mode in {'RGBA', 'P'}:
img = img.convert('RGB')
img.save(data, format='jpeg', optimize=True, **_params)