mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
Unit test and image: convert hopper.png hopper.bmp
This commit is contained in:
parent
0564979cf9
commit
593a910e92
BIN
Tests/images/hopper.bmp
Normal file
BIN
Tests/images/hopper.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
|
@ -49,6 +49,22 @@ class TestFileBmp(PillowTestCase):
|
|||
|
||||
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__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user