Slightly simplify imgformat retrieval #201
1 changed files with 3 additions and 5 deletions
|
@ -1832,11 +1832,9 @@ def read_images(
|
|||
)
|
||||
else:
|
||||
logger.debug("PIL format = %s", imgdata.format)
|
||||
imgformat = None
|
||||
for f in ImageFormat:
|
||||
if f.name == imgdata.format:
|
||||
imgformat = f
|
||||
if imgformat is None:
|
||||
try:
|
||||
imgformat = ImageFormat[imgdata.format]
|
||||
except KeyError:
|
||||
imgformat = ImageFormat.other
|
||||
|
||||
def cleanup():
|
||||
|
|
Loading…
Reference in a new issue