Skip to content

Use _accept check in WebP _open#9605

Open
radarhere wants to merge 1 commit intopython-pillow:mainfrom
radarhere:webp
Open

Use _accept check in WebP _open#9605
radarhere wants to merge 1 commit intopython-pillow:mainfrom
radarhere:webp

Conversation

@radarhere
Copy link
Copy Markdown
Member

Adds the _accept check into WebP _open.

This is already done by some other plugins. For example,

def _open(self) -> None:
# Screen
assert self.fp is not None
s = self.fp.read(13)
if not _accept(s):
msg = "not a GIF file"
raise SyntaxError(msg)

@radarhere radarhere added the WebP label May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant