Replace lena_g4.tif with hopper_g4.tif

This commit is contained in:
Hugo 2014-09-23 10:30:55 +03:00
parent c417b51115
commit 5957f5c812
2 changed files with 13 additions and 14 deletions

View File

@ -15,20 +15,20 @@ class TestFileLibTiffSmall(LibTiffTestCase):
file just before reading in libtiff. These tests remain
to ensure that it stays fixed. """
def test_g4_lena_file(self):
def test_g4_hopper_file(self):
"""Testing the open file load path"""
file = "Tests/images/lena_g4.tif"
file = "Tests/images/hopper_g4.tif"
with open(file, 'rb') as f:
im = Image.open(f)
self.assertEqual(im.size, (128, 128))
self._assert_noerr(im)
def test_g4_lena_bytesio(self):
def test_g4_hopper_bytesio(self):
"""Testing the bytesio loading code path"""
from io import BytesIO
file = "Tests/images/lena_g4.tif"
file = "Tests/images/hopper_g4.tif"
s = BytesIO()
with open(file, 'rb') as f:
s.write(f.read())
@ -38,10 +38,10 @@ class TestFileLibTiffSmall(LibTiffTestCase):
self.assertEqual(im.size, (128, 128))
self._assert_noerr(im)
def test_g4_lena(self):
"""The 128x128 lena image fails for some reason. Investigating"""
def test_g4_hopper(self):
"""The 128x128 lena image failed for some reason."""
file = "Tests/images/lena_g4.tif"
file = "Tests/images/hopper_g4.tif"
im = Image.open(file)
self.assertEqual(im.size, (128, 128))

View File

@ -31,26 +31,25 @@ class TestFileTiffMetadata(PillowTestCase):
self.assertEqual(loaded.tag[50839], textdata)
def test_read_metadata(self):
img = Image.open('Tests/images/lena_g4.tif')
img = Image.open('Tests/images/hopper_g4.tif')
known = {'YResolution': ((1207959552, 16777216),),
known = {'YResolution': ((4294967295L, 113653537),),
'PlanarConfiguration': (1,),
'BitsPerSample': (1,),
'ImageLength': (128,),
'Compression': (4,),
'FillOrder': (1,),
'DocumentName': 'lena.g4.tif',
'RowsPerStrip': (128,),
'ResolutionUnit': (1,),
'ResolutionUnit': (3,),
'PhotometricInterpretation': (0,),
'PageNumber': (0, 1),
'XResolution': ((1207959552, 16777216),),
'XResolution': ((4294967295L, 113653537),),
'ImageWidth': (128,),
'Orientation': (1,),
'StripByteCounts': (1796,),
'StripByteCounts': (1968,),
'SamplesPerPixel': (1,),
'StripOffsets': (8,),
'Software': 'ImageMagick 6.5.7-8 2012-08-17 Q16 http://www.imagemagick.org'}
}
# self.assertEqual is equivalent,
# but less helpful in telling what's wrong.