Removed manual determination of mmap file length

This commit is contained in:
Andrew Murray 2018-07-01 12:09:23 +10:00
parent 531f13828a
commit dbf899fb78

View File

@ -175,8 +175,7 @@ class ImageFile(Image.Image):
# use mmap, if possible
import mmap
fp = open(self.filename, "r")
size = os.path.getsize(self.filename)
self.map = mmap.mmap(fp.fileno(), size, access=mmap.ACCESS_READ)
self.map = mmap.mmap(fp.fileno(), 0, access=mmap.ACCESS_READ)
self.im = Image.core.map_buffer(
self.map, self.size, decoder_name, extents, offset, args
)