mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-10 16:40:51 +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)
|
stride = len(bits) * ((im.size[0] * bits[0] + 7) // 8)
|
||||||
# aim for 64 KB strips when using libtiff writer
|
# aim for 64 KB strips when using libtiff writer
|
||||||
if libtiff:
|
if libtiff:
|
||||||
rows_per_strip = (2 ** 16 + stride - 1) // stride
|
rows_per_strip = min((2 ** 16 + stride - 1) // stride, im.size[1])
|
||||||
else:
|
else:
|
||||||
rows_per_strip = im.size[1]
|
rows_per_strip = im.size[1]
|
||||||
strip_byte_counts = stride * rows_per_strip
|
strip_byte_counts = stride * rows_per_strip
|
||||||
|
|
Loading…
Reference in New Issue
Block a user