I kept getting a validation error in the django admin pages while trying to upload an image. The validation error said:
Upload a valid image. The file you uploaded was either not an image or
I really broke my brains on this one but finally got it to work! I knew for sure that the image was not corrupted so it had to be something else. After some googling I found a couple of pages on the Python Imagina Library and how it was kinda difficult to get that installed properly on MacOS. When I first installed Django I just used the standard “python setup.py install” command for installing PIL, but that did not install it correctly.
What worked for me was the following:
cp /usr/share/libtool/config.sub .
cp /usr/share/libtool/config.guess .
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/man/man1
sudo make install
JPEG_ROOT = none
ZLIB_ROOT = none
JPEG_ROOT = “/usr/local/include”
ZLIB_ROOT = “/usr/local/include”
python setup.py build_ext -i
sudo python setup.py install
That should be it! Hope that helps anyone!