Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept methods cleanup #5724

Merged
merged 3 commits into from Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/example/DdsImagePlugin.py
Expand Up @@ -269,9 +269,9 @@ def decode(self, buffer):
Image.register_decoder("DXT5", DXT5Decoder)


def _validate(prefix):
def _accept(prefix):
return prefix[:4] == b"DDS "


Image.register_open(DdsImageFile.format, DdsImageFile, _validate)
Image.register_open(DdsImageFile.format, DdsImageFile, _accept)
Image.register_extension(DdsImageFile.format, ".dds")
5 changes: 2 additions & 3 deletions src/PIL/MpoImagePlugin.py
Expand Up @@ -21,9 +21,8 @@
from . import Image, ImageFile, JpegImagePlugin
from ._binary import i16be as i16


def _accept(prefix):
return JpegImagePlugin._accept(prefix)
# def _accept(prefix):
# return JpegImagePlugin._accept(prefix)


def _save(im, fp, filename):
Expand Down