mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-08 06:14:45 +03:00
Debugging on tests
This commit is contained in:
parent
f90a515464
commit
40e5265c3b
|
@ -448,7 +448,11 @@ class ImageFileDirectory(collections.MutableMapping):
|
|||
# Get and expand tag value
|
||||
if size > 4:
|
||||
here = fp.tell()
|
||||
if Image.DEBUG:
|
||||
print ("Tag Location: %s" %here)
|
||||
fp.seek(i32(ifd, 8))
|
||||
if Image.DEBUG:
|
||||
print ("Data Location: %s" %fp.tell())
|
||||
data = ImageFile._safe_read(fp, size)
|
||||
fp.seek(here)
|
||||
else:
|
||||
|
@ -654,7 +658,12 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
while self.__frame < frame:
|
||||
if not self.__next:
|
||||
raise EOFError("no more images in TIFF file")
|
||||
if Image.DEBUG:
|
||||
print("Seeking to frame %s, on frame %s, __next %s, location: %s"%
|
||||
(frame, self.__frame, self.__next, self.fp.tell()))
|
||||
self.fp.seek(self.__next)
|
||||
if Image.DEBUG:
|
||||
print("Loading tags, location: %s"%self.fp.tell())
|
||||
self.tag.load(self.fp)
|
||||
self.__next = self.tag.next
|
||||
self.__frame += 1
|
||||
|
|
|
@ -314,6 +314,7 @@ class TestFileLibTiff(PillowTestCase):
|
|||
def test_multipage(self):
|
||||
# issue #862
|
||||
TiffImagePlugin.READ_LIBTIFF = True
|
||||
Image.DEBUG=True
|
||||
im = Image.open('Tests/images/multipage.tiff')
|
||||
# file is a multipage tiff, 10x10 green, 10x10 red, 20x20 blue
|
||||
|
||||
|
@ -331,6 +332,7 @@ class TestFileLibTiff(PillowTestCase):
|
|||
self.assertFalse(im.tag.next)
|
||||
self.assertEqual(im.size, (20,20))
|
||||
self.assertEqual(im.convert('RGB').getpixel((0,0)), (0,0,255))
|
||||
Image.DEBUG=False
|
||||
|
||||
TiffImagePlugin.READ_LIBTIFF = False
|
||||
|
||||
|
|
|
@ -23,11 +23,13 @@ class TestImageSequence(PillowTestCase):
|
|||
self.assertEqual(index, 1)
|
||||
|
||||
def _test_multipage_tiff(self):
|
||||
Image.DEBUG=True
|
||||
im = Image.open('Tests/images/multipage.tiff')
|
||||
for index, frame in enumerate(ImageSequence.Iterator(im)):
|
||||
frame.load()
|
||||
self.assertEqual(index, im.tell())
|
||||
frame.convert('RGB')
|
||||
Image.DEBUG=False
|
||||
|
||||
def test_tiff(self):
|
||||
return self._test_multipage_tiff()
|
||||
|
|
Loading…
Reference in New Issue
Block a user