Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented May 21, 2025

WmfImagePlugin initially reads 80 bytes.

s = self.fp.read(80)

However, the furthest that is used is byte 44.

elif s.startswith(b"\x01\x00\x00\x00") and s[40:44] == b" EMF":

So the number of bytes can be reduced.

@hugovk hugovk merged commit 90f115c into python-pillow:main May 27, 2025
54 of 55 checks passed
@radarhere radarhere deleted the wmf branch May 27, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants