Misc improvements.

This commit is contained in:
Cédric Bonhomme 2016-05-21 22:20:05 +02:00
parent 6cd22dfe72
commit d850bbd8a0
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
6 changed files with 30 additions and 31 deletions

View file

@ -41,8 +41,10 @@ def hide(input_image_file, message, generator_function, auto_convert_rgb=False):
Hide a message (string) in an image with the
LSB (Least Significant Bit) technique.
"""
img = Image.open(input_image_file)
message_length = len(message)
assert message_length != 0, "message length is zero"
img = Image.open(input_image_file)
if img.mode != 'RGB':
print('The mode of the image is not RGB. Mode is {}'.format(img.mode))
if not auto_convert_rgb: