mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 01:34:24 +03:00
Put upper limit on rows per strip
This commit is contained in:
parent
1c4deefe11
commit
0ae2981957
|
@ -1560,7 +1560,7 @@ def _save(im, fp, filename):
|
|||
stride = len(bits) * ((im.size[0] * bits[0] + 7) // 8)
|
||||
# aim for 64 KB strips when using libtiff writer
|
||||
if libtiff:
|
||||
rows_per_strip = (2 ** 16 + stride - 1) // stride
|
||||
rows_per_strip = min((2 ** 16 + stride - 1) // stride, im.size[1])
|
||||
else:
|
||||
rows_per_strip = im.size[1]
|
||||
strip_byte_counts = stride * rows_per_strip
|
||||
|
|
Loading…
Reference in New Issue
Block a user