After uploading a file via a form, I get the file with
fileitem = request.vars.files.file
store it into the file system
image = db.uploadedFile.image.store(fileitem, filename)
and then get the size
fileitem.seek(0,2) filesize = fileitem.tell() fileitem.seek(0)
Then I need to make some change to it so i do
image_to_transform = Image.open(fileitem)
However i get a
File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 2020, in open raise IOError("cannot identify image file") IOError: cannot identify image file
I can see that the files are correctly stored on PA and it also works locally on my computer. I don't understand the problem. Should i open the file with a full path ? I'm a bit lost.
Thank you in advance for your feedback.
¨PS : I import PIL like this :
try: from PIL import Image except: import Image