I am running a Django application in virtualenv on Ubuntu using NGINX / FastCGI and am trying to load a JPG image into a Django admin application.
I get this error: "Upload a valid image. The file you uploaded was either not an image or a damaged image." I can upload a GIF image, so this only calls JPEG.
Here is what I have tried so far:
1) Install libjpeg62-dev before PIL
pip uninstall pil sudo apt-get libjpeg62-dev pip install pil
At the end of the PIL installation, I see:
PIL 1.1.7 SETUP SUMMARY -------------------------------------------------------------------- version 1.1.7 platform linux2 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] -------------------------------------------------------------------- *** TKINTER support not available --- JPEG support available --- ZLIB (PNG/ZIP) support available --- FREETYPE2 support available *** LITTLECMS support not available
So it looks like JPEG is supported. I also checked the check manually and confirmed:
>>> from PIL import Image >>> trial_image=Image.open("/path/to/my/image.png") >>> trial_image.verify()
2) Similar to approach # 1 above, but manually specifying JPG_ROOT:
pip uninstall pil sudo apt-get libjpeg62-dev pip install
3) Try your luck with the pillow (PIL plug)
pip uninstall pil sudo apt-get libjpeg62-dev pip install pillow
I am running Django. I am also trying to stop and start the nginx service after each PIL installation.
So far, none of the above approaches have passed me the previous error message in my Django application on Ubuntu. I can upload the same JPG image, just fine in my local dev block (Mac OSX 10.6.5) running the same Django application, so I know something with my deployment on Ubuntu.
Any help would be appreciated!