Changeset 6096
- Timestamp:
- 09/11/07 08:13:35 (1 year ago)
- Files:
-
- django/trunk/django/core/validators.py (modified) (1 diff)
- django/trunk/django/newforms/fields.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/validators.py
r6068 r6096 183 183 try: 184 184 Image.open(StringIO(content)) 185 except IOError: # Python Imaging Library doesn't recognize it as an image 185 except (IOError, OverflowError): # Python Imaging Library doesn't recognize it as an image 186 # OverflowError is due to a bug in PIL with Python 2.4+ which can cause 187 # it to gag on OLE files. 186 188 raise ValidationError, _("Upload a valid image. The file you uploaded was either not an image or a corrupted image.") 187 189 django/trunk/django/newforms/fields.py
r6068 r6096 394 394 try: 395 395 Image.open(StringIO(f.content)) 396 except IOError: # Python Imaging Library doesn't recognize it as an image 396 except (IOError, OverflowError): # Python Imaging Library doesn't recognize it as an image 397 # OverflowError is due to a bug in PIL with Python 2.4+ which can cause 398 # it to gag on OLE files. 397 399 raise ValidationError(ugettext(u"Upload a valid image. The file you uploaded was either not an image or a corrupted image.")) 398 400 return f
