fix: replace Image.ANTIALIAS with Image.LANCZOS in resize_image function to resolve AttributeError

This commit is contained in:
Manuel Weiser 2024-09-03 14:55:24 +02:00
parent 47dade0384
commit c5ec574873

View File

@ -31,7 +31,7 @@ def resize_image(image_path, max_height=50):
aspect_ratio = img.width / img.height aspect_ratio = img.width / img.height
new_height = min(max_height, img.height) new_height = min(max_height, img.height)
new_width = int(aspect_ratio * new_height) new_width = int(aspect_ratio * new_height)
img = img.resize((new_width, new_height), Image.ANTIALIAS) img = img.resize((new_width, new_height), Image.LANCZOS)
img.save(image_path) img.save(image_path)
@app.route('/games', methods=['POST']) @app.route('/games', methods=['POST'])