Correctness tests for DDS

This commit is contained in:
wiredfool 2016-01-08 07:59:18 -08:00
parent 37b5a39c58
commit 13f2d22700
3 changed files with 8 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -17,7 +17,10 @@ class TestFileDds(PillowTestCase):
self.assertEqual(im.format, "DDS")
self.assertEqual(im.mode, "RGBA")
self.assertEqual(im.size, (256, 256))
self.assertIsInstance(im, DdsImagePlugin.DdsImageFile)
target = Image.open(TEST_FILE_DXT1.replace('.dds', '.png'))
target.show()
self.assert_image_equal(target.convert('RGBA'), im)
def test_sanity_dxt5(self):
"""Check DXT5 images can be opened"""
@ -26,7 +29,10 @@ class TestFileDds(PillowTestCase):
self.assertEqual(im.format, "DDS")
self.assertEqual(im.mode, "RGBA")
self.assertEqual(im.size, (256, 256))
self.assertIsInstance(im, DdsImagePlugin.DdsImageFile)
target = Image.open(TEST_FILE_DXT5.replace('.dds', '.png'))
self.assert_image_equal(target, im)
def test_sanity_dxt3(self):
"""Check DXT3 images are not supported"""