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

Fixed #19934 - Use of Pillow is now preferred over PIL.

This starts the deprecation period for PIL (support to end in 1.8).
This commit is contained in:
Daniel Lindsley
2013-05-14 19:31:16 -07:00
parent c792c83cad
commit 33793f7c3e
13 changed files with 198 additions and 66 deletions

View File

@@ -1,7 +1,7 @@
"""
Utility functions for handling images.
Requires PIL, as you might imagine.
Requires Pillow (or PIL), as you might imagine.
"""
import zlib
@@ -35,11 +35,7 @@ def get_image_dimensions(file_or_path, close=False):
'close' to True to close the file at the end if it is initially in an open
state.
"""
# Try to import PIL in either of the two ways it can end up installed.
try:
from PIL import ImageFile as PILImageFile
except ImportError:
import ImageFile as PILImageFile
from django.utils.image import ImageFile as PILImageFile
p = PILImageFile.Parser()
if hasattr(file_or_path, 'read'):