python-pillow / Pillow

Python Imaging Library (Fork)
https://python-pillow.org
Other
12.32k stars 2.23k forks source link

Use ImageFile.MAXBLOCK when saving TIFF images #8461

Closed radarhere closed 1 month ago

radarhere commented 1 month ago

Addresses an 'undone' that has been present since #98

https://github.com/python-pillow/Pillow/blob/08b561e25dd58daa6bc86989d1a8e55795a6b81e/src/PIL/TiffImagePlugin.py#L1940-L1941

self.decodermaxblock isn't necessarily available, because im may not be an ImageFile instance, but ImageFile.MAXBLOCK is usually the same.

https://github.com/python-pillow/Pillow/blob/08b561e25dd58daa6bc86989d1a8e55795a6b81e/src/PIL/ImageFile.py#L128