Use MAXBLOCK

This commit is contained in:
Andrew Murray 2024-10-12 13:44:48 +11:00
parent 08b561e25d
commit 00c5989d4e

View File

@ -1937,8 +1937,7 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
encoder = Image._getencoder(im.mode, "libtiff", a, encoderconfig)
encoder.setimage(im.im, (0, 0) + im.size)
while True:
# undone, change to self.decodermaxblock:
errcode, data = encoder.encode(16 * 1024)[1:]
errcode, data = encoder.encode(ImageFile.MAXBLOCK)[1:]
if not _fp:
fp.write(data)
if errcode: