mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-11 17:00:58 +00:00
Future-proofing our PIL imports, fixes #37.
This commit is contained in:
parent
2d4f116e57
commit
56d8b80a12
1 changed files with 6 additions and 10 deletions
|
|
@ -1,17 +1,13 @@
|
|||
# Required PIL classes may or may not be available from the root namespace
|
||||
# depending on the installation method used.
|
||||
try:
|
||||
import Image
|
||||
import ImageFile
|
||||
import ImageFilter
|
||||
import ImageEnhance
|
||||
import ImageColor
|
||||
from PIL import Image, ImageColor, ImageEnhance, ImageFile, ImageFilter
|
||||
except ImportError:
|
||||
try:
|
||||
from PIL import Image
|
||||
from PIL import ImageFile
|
||||
from PIL import ImageFilter
|
||||
from PIL import ImageEnhance
|
||||
from PIL import ImageColor
|
||||
import Image
|
||||
import ImageColor
|
||||
import ImageEnhance
|
||||
import ImageFile
|
||||
import ImageFilter
|
||||
except ImportError:
|
||||
raise ImportError('ImageKit was unable to import the Python Imaging Library. Please confirm it`s installed and available on your current Python path.')
|
||||
|
|
|
|||
Loading…
Reference in a new issue