1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Removed PIL compatability layer per deprecation timeline.

refs #19934.
This commit is contained in:
Tim Graham
2014-03-21 10:54:53 -04:00
parent 6d1ae5e27c
commit 4965a77407
15 changed files with 48 additions and 211 deletions

View File

@@ -641,7 +641,7 @@ class ImageField(FileField):
if f is None:
return None
from django.utils.image import Image
from PIL import Image
# We need to get a file object for Pillow. We might have a path or we might
# have to read the data into memory.
@@ -659,7 +659,7 @@ class ImageField(FileField):
# verify() must be called immediately after the constructor.
Image.open(file).verify()
except Exception:
# Pillow (or PIL) doesn't recognize it as an image.
# Pillow doesn't recognize it as an image.
six.reraise(ValidationError, ValidationError(
self.error_messages['invalid_image'],
code='invalid_image',