mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
spider labrec ceil
This commit is contained in:
parent
26babb525a
commit
17d9938ece
|
@ -1,4 +1,5 @@
|
|||
import tempfile
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image, ImageSequence, SpiderImagePlugin
|
||||
|
||||
|
@ -117,3 +118,14 @@ class TestImageSpider(PillowTestCase):
|
|||
for i, frame in enumerate(ImageSequence.Iterator(im)):
|
||||
if i > 1:
|
||||
self.fail("Non-stack DOS file test failed")
|
||||
|
||||
# for issue #4093
|
||||
def test_odd_size(self):
|
||||
data = BytesIO()
|
||||
width = 100
|
||||
im = Image.new("F", (width, 64))
|
||||
im.save(data, format="SPIDER")
|
||||
|
||||
data.seek(0)
|
||||
im2 = Image.open(data)
|
||||
self.assert_image_equal(im, im2)
|
||||
|
|
|
@ -236,7 +236,7 @@ def loadImageSeries(filelist=None):
|
|||
def makeSpiderHeader(im):
|
||||
nsam, nrow = im.size
|
||||
lenbyt = nsam * 4 # There are labrec records in the header
|
||||
labrec = 1024 / lenbyt
|
||||
labrec = int(1024 / lenbyt)
|
||||
if 1024 % lenbyt != 0:
|
||||
labrec += 1
|
||||
labbyt = labrec * lenbyt
|
||||
|
|
Loading…
Reference in New Issue
Block a user