Ticket #4478: pil_validator_fix.patch
File pil_validator_fix.patch, 837 bytes (added by , 17 years ago) |
---|
-
django/core/validators.py
175 175 raise ValidationError, gettext("No file was submitted. Check the encoding type on the form.") 176 176 try: 177 177 Image.open(StringIO(content)) 178 except IOError: # Python Imaging Library doesn't recognize it as an image 178 except IOError, OverflowError: # Python Imaging Library doesn't recognize it as an image 179 # OverflowError is due to a bug in PIL with Python 2.4+ which can cause 180 # it to gag on OLE files. 179 181 raise ValidationError, gettext("Upload a valid image. The file you uploaded was either not an image or a corrupted image.") 180 182 181 183 def isValidImageURL(field_data, all_data):