I'm trying to upload an image using normal form for normal admin for normal model with normal image field.
thumb = fields.ThumbnailField(upload_to=make_upload_path, sizes=settings.VIDEO_THUMB_SIZE, 开发者_运维问答blank=True, null=True)
But I'm getting an error:
Upload a valid image. The file you uploaded was either not an image or a corrupted image.
But my images are valid! I've tried at least ten jpegs and getting the error. What can I do?
You probably have PIL (Python Imaging Library) installed without JPEG support. If you don't have the libjpeg header files it'll happily compile and install, just with no JPEG support. You need to uninstall PIL, make sure you install libjpeg and the libjpeg development header files, and then reinstall PIL. How you do this depends entirely on your platform.
精彩评论