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:
@@ -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'):
|
||||
|
||||
Reference in New Issue
Block a user