Merge pull request #1321 from radarhere/handler

Rearranged format handler fetching
This commit is contained in:
Alex Clark 2015-07-01 14:31:22 -04:00
commit 0d9d288a60

View File

@ -1682,14 +1682,9 @@ class Image(object):
ext = os.path.splitext(filename)[1].lower()
if not format:
try:
format = EXTENSION[ext]
except KeyError:
if ext not in EXTENSION:
init()
try:
format = EXTENSION[ext]
except KeyError:
raise KeyError(ext) # unknown extension
format = EXTENSION[ext]
if format.upper() not in SAVE:
init()