Problem: When uploading images to Satchmo I got this error message: "Upload a valid image. The file you uploaded was either not an image or a corrupted image."
even with valid JPEG files.
To test the Python Image Library (PIL) I’d executed this code on python console:
from PIL import Image
file = open("/tmp/logo.jpg")
image_test = Image.open(file)
image_test.load()
what output:
<PixelAccess object at 0x37dce100>
This is ok, but when I’d run the same code inside a Django view I got the error "decoding error when reading image file"
.
I checked the Python Path and it was the same for both console and Django Application.
After looking on google I discover a post from Peter Schoenster on “Django-Photologue” wiki page saying he had the same problem and discovered that python shell was using one version of libjpeg and Apache was using other. (He, as me had two version of this library on the system). He discovered it using the command
# lsof | grep libjpeg
I just remove the old libjpe62 from my system using:
# apt-get remove libjpeg62
And everything works !
Problem: Error on Uploading a image file to Satchmo. Message: "Upload a valid image. The file you uploaded was either not an image or a corrupted image."
To test the Python Image Library (PIL) I run this code on python console:
from PIL import Image
file = open("/tmp/logo.jpg")
image_test = Image.open(file)
image_test.load()
what output:
<PixelAccess object at 0x37dce100>
This is ok, but when I run the same code inside a Django view I got the error "decoding error when reading image file"
.
I checked the Python Path and it was the same for both console and Django Application.
After looking on google I discover a post from Peter Schoenster on “Django-Photologue” home page saying he had the same problem and discovered that python shell was using one version of libjpeg and Apache was using other. (He, as me had two version of this library on the system). He discovered it using the command
# lsof | grep libjpeg
I just remove the old libjpe62 from my system using:
# apt-get remove libjpeg62
And everything works !