Django

Code

Changeset 8249

Show
Ignore:
Timestamp:
08/08/08 16:57:25 (4 months ago)
Author:
jacob
Message:

Don't import PIL until needed so that systems without PIL don't barf.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/files/images.py

    r8244 r8249  
    55""" 
    66 
    7 from PIL import ImageFile as PIL 
    87from django.core.files import File 
    98 
     
    2827def get_image_dimensions(file_or_path): 
    2928    """Returns the (width, height) of an image, given an open file or a path.""" 
    30     p = PIL.Parser() 
     29    from PIL import ImageFile as PILImageFile 
     30    p = PILImageFile.Parser() 
    3131    if hasattr(file_or_path, 'read'): 
    3232        file = file_or_path