PIL: ValueError: unknown resampling filter, How to resize images uploaded on Flask?

前端 未结 2 1432
醉话见心
醉话见心 2021-02-19 05:28

I\'m making a web app using Flask, and I want to resize the images that are uploaded. I\'m using PIL to do this, but an error is thrown.

The process to do it is like thi

相关标签:
2条回答
  • 2021-02-19 06:00

    img = img.resize(300, 300)

    => img = img.resize((300,300))

    0 讨论(0)
  • 2021-02-19 06:03

    The most important thing to remember is not to pass the size as object but as a tuple in resize function new_image = image.resize((img_width,img_size))

    and NOT AS

    new_image = image.resize(img_width,img_size)

    0 讨论(0)
提交回复
热议问题