| Django image upload failure problem and fix |
| Software |
| Thursday, 26 January 2012 23:42 |
|
On my Mac (Lion) I was getting an error when uploading images: "Upload a valid image. The file you uploaded was either not an image or a corrupted image." I guess django uses PIL for verification of a valid image. The problem as it turns out was that PIL was installed without JPEG support and I was trying to upload a JPEG image. The fix is very simple. You have to install libjpeg and then you have to reinstall PIL. brew install jpeg pip install pil --upgrade |