I have an image that I am uploading using Django Forms, and its available in the variable as InMemoryFile
What I want to do is to make it progressive.
Code to make an image a progressive
img = Image.open(source)
img.save(destination, "JPEG", quality=80, optimize=True, progressive=True)
Forms.py
my_file = pic.pic_url.file
photo = uploader.upload_picture_to_album(title=title, file_obj=my_file)
The issue is, I have to save the file in case I want to make it progressive, and open it again to send it to the server. (It seems a redundant actions to make it progressive)
I just want to know if there is anyway to make an image progressive which does not save the image physically on disk but in memory, which I can use the existing code to upload it?
Idea
Looking for something similar.
my_file=pic.pic_url.fileprogressive_file = (my_file)photo = picasa_api.upload_picture_to_album(title=title, file_obj=progressive_file)