开发者

Django uploading image error

开发者 https://www.devze.com 2022-12-14 16:29 出处:网络
I\'m trying to upload an image using normal form for normal admin for normal model with normal image field.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号