mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-13 13:16:52 +03:00
Attempt memory mapping when tile args is a string
This commit is contained in:
parent
9694cfcfda
commit
a07bac3a56
|
@ -187,6 +187,8 @@ class ImageFile(Image.Image):
|
||||||
if use_mmap:
|
if use_mmap:
|
||||||
# try memory mapping
|
# try memory mapping
|
||||||
decoder_name, extents, offset, args = self.tile[0]
|
decoder_name, extents, offset, args = self.tile[0]
|
||||||
|
if isinstance(args, str):
|
||||||
|
args = (args, 0, 1)
|
||||||
if (
|
if (
|
||||||
decoder_name == "raw"
|
decoder_name == "raw"
|
||||||
and len(args) >= 3
|
and len(args) >= 3
|
||||||
|
|
|
@ -168,6 +168,9 @@ class WebPImageFile(ImageFile.ImageFile):
|
||||||
|
|
||||||
return super().load()
|
return super().load()
|
||||||
|
|
||||||
|
def load_seek(self, pos):
|
||||||
|
pass
|
||||||
|
|
||||||
def tell(self):
|
def tell(self):
|
||||||
if not _webp.HAVE_WEBPANIM:
|
if not _webp.HAVE_WEBPANIM:
|
||||||
return super().tell()
|
return super().tell()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user