mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 01:04:29 +03:00
added test for reading TIFF from non-disk file obj
This commit is contained in:
parent
597ca79b1b
commit
457a97dde8
|
@ -81,6 +81,19 @@ class TestFileLibTiff(LibTiffTestCase):
|
|||
self.assertEqual(im.size, (500, 500))
|
||||
self._assert_noerr(im)
|
||||
|
||||
def test_g4_non_disk_file_object(self):
|
||||
"""Testing loading from non-disk non-bytesio file object"""
|
||||
test_file = "Tests/images/hopper_g4_500.tif"
|
||||
s = io.BytesIO()
|
||||
with open(test_file, "rb") as f:
|
||||
s.write(f.read())
|
||||
s.seek(0)
|
||||
r = io.BufferedReader(s)
|
||||
im = Image.open(r)
|
||||
|
||||
self.assertEqual(im.size, (500, 500))
|
||||
self._assert_noerr(im)
|
||||
|
||||
def test_g4_eq_png(self):
|
||||
""" Checking that we're actually getting the data that we expect"""
|
||||
png = Image.open("Tests/images/hopper_bw_500.png")
|
||||
|
|
Loading…
Reference in New Issue
Block a user