From 885e305fe97761fdfc7b3cab414ff995af76d605 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 26 Feb 2022 17:34:29 +1100 Subject: [PATCH] Make code clearer by matching _accept condition --- src/PIL/WmfImagePlugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PIL/WmfImagePlugin.py b/src/PIL/WmfImagePlugin.py index c32cc52f8..2f54cdebb 100644 --- a/src/PIL/WmfImagePlugin.py +++ b/src/PIL/WmfImagePlugin.py @@ -21,7 +21,6 @@ from . import Image, ImageFile from ._binary import i16le as word -from ._binary import i32le as dword from ._binary import si16le as short from ._binary import si32le as _long @@ -112,7 +111,7 @@ class WmfStubImageFile(ImageFile.StubImageFile): if s[22:26] != b"\x01\x00\t\x00": raise SyntaxError("Unsupported WMF file format") - elif dword(s) == 1 and s[40:44] == b" EMF": + elif s[:4] == b"\x01\x00\x00\x00" and s[40:44] == b" EMF": # enhanced metafile # get bounding box