mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Added additional tests for TiffImagePlugin
This commit is contained in:
parent
affa2d9a22
commit
c7339c244e
|
@ -82,6 +82,13 @@ class TestFileTiff(PillowTestCase):
|
||||||
im._setup()
|
im._setup()
|
||||||
self.assertEqual(im.info['dpi'], (72., 72.))
|
self.assertEqual(im.info['dpi'], (72., 72.))
|
||||||
|
|
||||||
|
def test_invalid_file(self):
|
||||||
|
invalid_file = "Tests/images/flower.jpg"
|
||||||
|
|
||||||
|
self.assertRaises(SyntaxError,
|
||||||
|
lambda: TiffImagePlugin.TiffImageFile(invalid_file))
|
||||||
|
|
||||||
|
|
||||||
def test_bad_exif(self):
|
def test_bad_exif(self):
|
||||||
try:
|
try:
|
||||||
Image.open('Tests/images/hopper_bad_exif.jpg')._getexif()
|
Image.open('Tests/images/hopper_bad_exif.jpg')._getexif()
|
||||||
|
@ -89,6 +96,12 @@ class TestFileTiff(PillowTestCase):
|
||||||
self.fail(
|
self.fail(
|
||||||
"Bad EXIF data passed incorrect values to _binary unpack")
|
"Bad EXIF data passed incorrect values to _binary unpack")
|
||||||
|
|
||||||
|
def test_save_unsupported_mode(self):
|
||||||
|
im = hopper("HSV")
|
||||||
|
outfile = self.tempfile("temp.tif")
|
||||||
|
|
||||||
|
self.assertRaises(IOError, lambda: im.save(outfile))
|
||||||
|
|
||||||
def test_little_endian(self):
|
def test_little_endian(self):
|
||||||
im = Image.open('Tests/images/16bit.cropped.tif')
|
im = Image.open('Tests/images/16bit.cropped.tif')
|
||||||
self.assertEqual(im.getpixel((0, 0)), 480)
|
self.assertEqual(im.getpixel((0, 0)), 480)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user