mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-13 09:28:31 +02:00
Raise an exception if the message to hide is too long. resolves #1
This commit is contained in:
parent
60f9752dc1
commit
e2210bab54
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
#-*- coding: utf-8 -*-
|
#-*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Stéganô - Stéganô is a basic Python Steganography module.
|
# Stéganô - Stéganô is a basic Python Steganography module.
|
||||||
# Copyright (C) 2010-2013 Cédric Bonhomme - http://cedricbonhomme.org/
|
# Copyright (C) 2010-2011 Cédric Bonhomme - http://cedricbonhomme.org/
|
||||||
#
|
#
|
||||||
# For more information : http://bitbucket.org/cedricbonhomme/stegano/
|
# For more information : http://bitbucket.org/cedricbonhomme/stegano/
|
||||||
#
|
#
|
||||||
|
@ -46,7 +46,7 @@ def hide(input_image_file, message):
|
||||||
|
|
||||||
npixels = width * height
|
npixels = width * height
|
||||||
if len(message_bits) > npixels * 3:
|
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))
|
||||||
|
|
||||||
for row in xrange(height):
|
for row in xrange(height):
|
||||||
for col in xrange(width):
|
for col in xrange(width):
|
||||||
|
|
Loading…
Add table
Reference in a new issue