Merge pull request #5724 from radarhere/accept

This commit is contained in:
Hugo van Kemenade 2021-09-20 18:10:49 +03:00 committed by GitHub
commit ffde039f26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -269,9 +269,9 @@ Image.register_decoder("DXT1", DXT1Decoder)
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")

View File

@ -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):