Django / PIL - save thumbnail version right when image is uploaded

前端 未结 6 805
挽巷
挽巷 2021-01-30 09:39

This is my forms.py:

class UploadImageForm(forms.ModelForm):
    class Meta:
        model = UserImages
        fields = [\'photo\']

and this i

6条回答
  •  醉梦人生
    2021-01-30 10:14

    Probably you have forgotten save a file:

    im.save(file + ".thumbnail", "JPEG")
    

    See http://effbot.org/imagingbook/image.htm#examples

提交回复
热议问题