Преглед изворни кода

[2.8.2] Removing upscaling of small pictures

Penta пре 3 недеља
родитељ
комит
a3f5ebea11
1 измењених фајлова са 0 додато и 5 уклоњено
  1. 0 5
      chatbot.py

+ 0 - 5
chatbot.py

@@ -174,11 +174,6 @@ def resize_image(image_bytes, attachment_filename=None):
 
             img.thumbnail((2000, 2000))
 
-            if min(img.size) < 768:
-                scale = 768 / min(img.size)
-                new_size = tuple(int(x * scale) for x in img.size)
-                img = img.resize(new_size, Image.Resampling.LANCZOS)
-
             buffer = BytesIO()
             img_format = img.format or _infer_image_format(attachment_filename)
             img.save(buffer, format=img_format)