Re: Help, question about upload image

2014-09-05 Thread 孟维康
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

Re: Help, question about upload image

2014-09-05 Thread Collin Anderson
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

Help, question about upload image

2014-09-05 Thread Weikang Meng
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