Skip to content

Commit

Permalink
Merge pull request #5724 from radarhere/accept
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Sep 20, 2021
2 parents 0a47b73 + 99428bb commit ffde039
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit ffde039

Please sign in to comment.