mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
Raise an exception if the message to hide is too long. closed #1
This commit is contained in:
parent
e2210bab54
commit
f629773772
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ def hide(input_image_file, message, generator_function):
|
|||
|
||||
npixels = width * height
|
||||
if len(message_bits) > npixels * 3:
|
||||
return """Too long message (%s > %s).""" % (len(message_bits), npixels * 3)
|
||||
raise Exception("""The message you want to hide is too long (%s > %s).""" % (len(message_bits), npixels * 3))
|
||||
|
||||
generator = getattr(generators, generator_function)()
|
||||
|
||||
|
@ -180,4 +180,4 @@ if __name__ == '__main__':
|
|||
with open(options.secret_binary, "w") as f:
|
||||
f.write(data)
|
||||
else:
|
||||
print secret
|
||||
print secret
|
||||
|
|
Loading…
Add table
Reference in a new issue