I have PIL installed, however whenever I try to upload a .png file to an image field through the Django Admin for my model, I get this error:
"Upload a valid image. The file you uploaded was either not an image or a corrupted image."
Other image types work fine. I have tried several different PNG files.
I have tried rebuilding PIL after installing pypng, libpng-dev, etc.. and am on ubuntu server.
This issue was solved by using pip to install "pillow" instead of "pil" which allows easy deployment to virtualenv.
When you compile PIL it should say if it has been compiled with PNG support or not, but if you have problems installing it yourself, I would recommend that you use the version that comes with ubuntu. It's strangely named but easily installed with:
apt-get install python-imaging
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With