django-imagekit/imagekit/lib.py

34 lines
952 B
Python
Raw Normal View History

2012-11-06 04:34:32 +00:00
# flake8: noqa
2009-01-08 21:11:15 +00:00
# Required PIL classes may or may not be available from the root namespace
# depending on the installation method used.
try:
2011-11-16 04:42:43 +00:00
from PIL import Image, ImageColor, ImageChops, ImageEnhance, ImageFile, \
ImageFilter, ImageDraw, ImageStat
2009-01-08 21:11:15 +00:00
except ImportError:
try:
import Image
import ImageColor
import ImageChops
import ImageEnhance
import ImageFile
import ImageFilter
2011-11-16 04:42:43 +00:00
import ImageDraw
import ImageStat
2009-01-08 21:11:15 +00:00
except ImportError:
2009-12-19 16:01:54 +00:00
raise ImportError('ImageKit was unable to import the Python Imaging Library. Please confirm it`s installed and available on your current Python path.')
2012-05-12 19:45:08 +00:00
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
from logging import NullHandler
except ImportError:
from logging import Handler
class NullHandler(Handler):
def emit(self, record):
pass