diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-08 21:57:25 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-08 21:57:25 +0000 |
| commit | 6f6024751c26ef054fec23f05746640bb0fcc5d1 (patch) | |
| tree | 9388fb8fa05b775ceb395da90d41b872e70162ea | |
| parent | 84afcf5a02ea1b6c59b992c2557b5e07f211e217 (diff) | |
Don't import PIL until needed so that systems without PIL don't barf.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/files/images.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/files/images.py b/django/core/files/images.py index 3fa5013027..5ddcdd4322 100644 --- a/django/core/files/images.py +++ b/django/core/files/images.py @@ -4,7 +4,6 @@ Utility functions for handling images. Requires PIL, as you might imagine. """ -from PIL import ImageFile as PIL from django.core.files import File class ImageFile(File): @@ -27,7 +26,8 @@ class ImageFile(File): def get_image_dimensions(file_or_path): """Returns the (width, height) of an image, given an open file or a path.""" - p = PIL.Parser() + from PIL import ImageFile as PILImageFile + p = PILImageFile.Parser() if hasattr(file_or_path, 'read'): file = file_or_path else: |
