Unit test and image: convert hopper.png hopper.bmp

This commit is contained in:
hugovk 2015-06-30 07:09:35 +03:00
parent 0564979cf9
commit 593a910e92
2 changed files with 16 additions and 0 deletions

BIN
Tests/images/hopper.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -49,6 +49,22 @@ class TestFileBmp(PillowTestCase):
self.assertEqual(reloaded.info["dpi"], dpi) self.assertEqual(reloaded.info["dpi"], dpi)
def test_save_bmp_with_dpi(self):
# Test for #1301
# Arrange
outfile = self.tempfile("temp.jpg")
im = Image.open("Tests/images/hopper.bmp")
# Act
im.save(outfile, 'JPEG', dpi=im.info['dpi'])
# Assert
reloaded = Image.open(outfile)
reloaded.load()
self.assertEqual(im.info['dpi'], reloaded.info['dpi'])
self.assertEqual(im.size, reloaded.size)
self.assertEqual(reloaded.format, "JPEG")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()