Initial protection for not having PIL (either not installed or not available, python3)

svn: r23372
This commit is contained in:
Doug Blank 2013-10-23 02:07:27 +00:00
parent e06051fa7c
commit 8ece67cab1

View File

@ -34,10 +34,13 @@ from django.template import Context, RequestContext
from django.http import HttpResponse
## Other Python Modules
from PIL import Image
NEW_PIL = [int(i) for i in Image.VERSION.split(".")] >= [1, 1, 7]
if not NEW_PIL:
from . import png
try:
from PIL import Image
NEW_PIL = [int(i) for i in Image.VERSION.split(".")] >= [1, 1, 7]
if not NEW_PIL:
from . import png
except:
print("WARNING: No PIL installed or available")
import os
## Globals