Django ImageField validation & PIL

Posted by Zayatzz on Stack Overflow See other posts from Stack Overflow or by Zayatzz
Published on 2009-08-18T05:59:17Z Indexed on 2010/05/05 19:58 UTC
Read the original article Hit count: 460

Filed under:
|
|
|
|

Hello

On sunday, I had problems with python modules, when I installed stackless python. Now I have compiled and installed :

setuptools & python-mysqldb and i got my django project up and running again. (i also reinstalled django-1.1),

Then I compiled and installed, jpeg, freetype2 and PIL. I also started using mod_wsgi instead of mod_python.

But when uploading imagefield in form I get validationerror:

Upload a valid image. The file you uploaded was either not an image or a corrupted image.

Searchmonkey shows that it comes from field.py imagefield validation. before raising this error it imports Image from PIL, opens file and verfies it. I tried importing PIL from python prompt manually - it worked just fine. Same with Image.open and Image.verify. So what could be causing this problem?

Alan

© Stack Overflow or respective owner

Related posts about django

Related posts about python