Skip to content

Commit 885e305

Browse files
committed
Make code clearer by matching _accept condition
1 parent 83b9e66 commit 885e305

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/PIL/WmfImagePlugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
from . import Image, ImageFile
2323
from ._binary import i16le as word
24-
from ._binary import i32le as dword
2524
from ._binary import si16le as short
2625
from ._binary import si32le as _long
2726

@@ -112,7 +111,7 @@ def _open(self):
112111
if s[22:26] != b"\x01\x00\t\x00":
113112
raise SyntaxError("Unsupported WMF file format")
114113

115-
elif dword(s) == 1 and s[40:44] == b" EMF":
114+
elif s[:4] == b"\x01\x00\x00\x00" and s[40:44] == b" EMF":
116115
# enhanced metafile
117116

118117
# get bounding box

0 commit comments

Comments
 (0)