changeset 975e089d2023 in trytond:6.0
details: https://hg.tryton.org/trytond?cmd=changeset&node=975e089d2023
description:
Use new image returned by PIL.Image methods
issue10703
review350531006
(grafted from b092e76193d8c6ca42ad11eab24efa01507c5306)
diffstat:
trytond/ir/avatar.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (19 lines):
diff -r b02d8774b6e9 -r 975e089d2023 trytond/ir/avatar.py
--- a/trytond/ir/avatar.py Wed Oct 20 15:16:10 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))
img.save(data, format='jpeg', optimize=True, **_params)
return data.getvalue()