changeset 554b738c5f98 in modules/product_image:default
details: 
https://hg.tryton.org/modules/product_image?cmd=changeset&node=554b738c5f98
description:
        Use new image returned by PIL.Image methods

        issue10703
        review350531006
diffstat:

 product.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r aa8e811fe0ac -r 554b738c5f98 product.py
--- a/product.py        Sun Aug 29 17:49:40 2021 +0200
+++ b/product.py        Sun Sep 05 14:40:15 2021 +0200
@@ -178,13 +178,13 @@
         img = PIL.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)

Reply via email to