Add support for transparent PNGs

This commit is contained in:
Andy Roberts 2017-01-27 17:19:21 +00:00
parent 673f7b5bc4
commit eea3f7ad6c
3 changed files with 28 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View file

@ -49,6 +49,17 @@ class TestLSB(unittest.TestCase):
self.assertEqual(message, clear_message)
def test_with_transparent_png(self):
messages_to_hide = ["a", "foo", "Hello World!", ":Python:"]
for message in messages_to_hide:
secret = lsb.hide("./tests/sample-files/transparent.png", message)
secret.save("./image.png")
clear_message = lsb.reveal("./image.png")
self.assertEqual(message, clear_message)
def test_with_text_file(self):
text_file_to_hide = "./tests/sample-files/lorem_ipsum.txt"
with open(text_file_to_hide) as f: