Help! PNG file upload error...

2009-04-08 Thread higer
When I upload a PNG file and use PIL to handle it,there will be an error occured: 'NoneType' object is unsubscriptable I do not know why and other formats(BMP GIF JPG JPEG) are all ok. The following is my code in my views.py: f = request.FILES["imagefile"] fileExt = (f.name).split(".")[-1].lowe

Re: Help! PNG file upload error...

2009-04-08 Thread Kushal Das
On Thu, Apr 9, 2009 at 11:15 AM, higer wrote: > > When I upload a PNG file and use PIL to handle it,there will be an > error occured: > 'NoneType' object is unsubscriptable > > I do not know why and other formats(BMP GIF JPG JPEG) are all ok. > The following is  my code in my views.py: > > f = re

Re: Help! PNG file upload error...

2009-04-10 Thread higer
I want to get a thumbnail version of the uploaded image,so I have to use PIL to handle it. But I do not know why that error occured. We can know that the chafferer is either the Django or the PIL. Then I wrote a .py script to handle images of different format ,all goes well.The operations are the

Re: Help! PNG file upload error...

2009-04-10 Thread Brian Neal
On Apr 9, 12:45 am, higer wrote: > When I upload a PNG file and use PIL to handle it,there will be an > error occured: > 'NoneType' object is unsubscriptable > > I do not know why and other formats(BMP GIF JPG JPEG) are all ok. I don't know if this is your problem, but in order to use certain fi

Re: Help! PNG file upload error...

2009-04-11 Thread higer
Thanks for your suggestion. But Python 2.5 already has zlib moudle. To png file,I wrote lines of code to save it first on disk and then handled the saved copy,then that works. I do not why there is some differencies between png file and file of other formats.The following is my code:

Re: Help! PNG file upload error...

2009-04-16 Thread higer
Can anyone tell me why does this problem occur? On Apr 12, 2:13 pm, higer wrote: > Thanks for your suggestion. But Python 2.5 already has zlib moudle. > To png file,I wrote lines of code to save it first on disk and then > handled the saved copy,then that works. > I do not why there is some diff