Slightly simplify imgformat retrieval #201
1 changed files with 1 additions and 6 deletions
|
@ -1832,12 +1832,7 @@ def read_images(
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.debug("PIL format = %s", imgdata.format)
|
logger.debug("PIL format = %s", imgdata.format)
|
||||||
imgformat = None
|
imgformat = getattr(ImageFormat, imgdata.format, ImageFormat.other)
|
||||||
for f in ImageFormat:
|
|
||||||
if f.name == imgdata.format:
|
|
||||||
imgformat = f
|
|
||||||
if imgformat is None:
|
|
||||||
imgformat = ImageFormat.other
|
|
||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
if imgdata is not None:
|
if imgdata is not None:
|
||||||
|
|
Loading…
Reference in a new issue