Thanks a lot for your help.
I got another way to do that with StringIO the same way as the tempfile.
Could you tell me which is better? I'm not good at programing and
working on it.
http://stackoverflow.com/questions/3723220/how-do-you-convert-a-pil-image-to-a-django-file
于 2014/9/6 2:07, Coll
That's more a of a pillow question than a django question, but something
like this might work:
import tempfile
imagefile = tempfile.TemporaryFile()
im.save(imagefile)
return imagefile
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubsc
Hello, I'm working on a Django project that need to upload images and
there's limit on the image file size(like 5M). I need to compress the image
if it is larger than the upper limit.
And my problem is *how can i return the compressed image data just like
the format of file.read()?*
Here's how
3 matches
Mail list logo