FileSystemStorage should make it easy to save other types of files
|Reported by:||julien||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
It is quite common to use PIL to modify an uploaded image, e.g. create a thumbnail:
from PIL import Image uploaded_image = Image.open(StringIO.StringIO(uploaded_file.read())) ... # Modify image, e.g. create thumbnail uploaded_image.save('/blah/image.gif') thumbnail_image.save('/blah/image_thumbnail.gif')
Now that the new file storage system has been merged in trunk, I could not find any easy way to use FileSystemStorage for saving PIL images. The problem is that FileSystemStorage assumes that it's given InMemoryUploadedFile or TemporaryUploadedFile (for example).
It seems quite essential that there should be a fall back option to manage other kinds of file content.
Change History (21)
Changed 8 years ago by julien
comment:1 Changed 8 years ago by julien
- milestone set to 1.0 maybe
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset