Skip to content

Use _accept check in WebP _open#9605

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:webp
May 12, 2026
Merged

Use _accept check in WebP _open#9605
radarhere merged 1 commit into
python-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
@radarhere radarhere merged commit 3ce6812 into python-pillow:main May 12, 2026
55 checks passed
@radarhere radarhere deleted the webp branch May 12, 2026 02:12
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