Attempt memory mapping when tile args is a string

This commit is contained in:
Andrew Murray 2023-11-21 21:45:14 +11:00
parent 9694cfcfda
commit a07bac3a56
2 changed files with 5 additions and 0 deletions

View File

@ -187,6 +187,8 @@ class ImageFile(Image.Image):
if use_mmap:
# try memory mapping
decoder_name, extents, offset, args = self.tile[0]
if isinstance(args, str):
args = (args, 0, 1)
if (
decoder_name == "raw"
and len(args) >= 3

View File

@ -168,6 +168,9 @@ class WebPImageFile(ImageFile.ImageFile):
return super().load()
def load_seek(self, pos):
pass
def tell(self):
if not _webp.HAVE_WEBPANIM:
return super().tell()