mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06:14 +02:00
Fixed some bugs.
This commit is contained in:
parent
cda0578448
commit
28ba1e54cf
6 changed files with 23 additions and 35 deletions
8
bin/slsb
8
bin/slsb
|
@ -27,7 +27,7 @@ __license__ = "GPLv3"
|
|||
try:
|
||||
from stegano import slsb
|
||||
except:
|
||||
print "Install stegano: python setup.py install"
|
||||
print("Install Stegano: sudo pip install Stegano")
|
||||
|
||||
from stegano import tools
|
||||
|
||||
|
@ -71,9 +71,9 @@ if options.hide:
|
|||
img_encoded = slsb.hide(options.input_image_file, secret)
|
||||
try:
|
||||
img_encoded.save(options.output_image_file)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# If hide() returns an error (Too long message).
|
||||
print e
|
||||
print(e)
|
||||
|
||||
elif options.reveal:
|
||||
secret = slsb.reveal(options.input_image_file)
|
||||
|
@ -82,4 +82,4 @@ elif options.reveal:
|
|||
with open(options.secret_binary, "w") as f:
|
||||
f.write(data)
|
||||
else:
|
||||
print secret
|
||||
print(secret)
|
||||
|
|
10
bin/slsb-set
10
bin/slsb-set
|
@ -27,7 +27,7 @@ __license__ = "GPLv3"
|
|||
try:
|
||||
from stegano import slsbset
|
||||
except:
|
||||
print "Install stegano: python setup.py install"
|
||||
print("Install stegano: sudo pip install Stegano")
|
||||
|
||||
from stegano import tools
|
||||
|
||||
|
@ -77,19 +77,19 @@ if options.hide:
|
|||
img_encoded = slsbset.hide(options.input_image_file, secret, options.generator_function)
|
||||
try:
|
||||
img_encoded.save(options.output_image_file)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# If hide() returns an error (Too long message).
|
||||
print e
|
||||
print(e)
|
||||
|
||||
elif options.reveal:
|
||||
try:
|
||||
secret = slsbset.reveal(options.input_image_file, options.generator_function)
|
||||
except IndexError:
|
||||
print "Impossible to detect message."
|
||||
print("Impossible to detect message.")
|
||||
exit(0)
|
||||
if options.secret_binary != "":
|
||||
data = tools.base642binary(secret)
|
||||
with open(options.secret_binary, "w") as f:
|
||||
f.write(data)
|
||||
else:
|
||||
print secret
|
||||
print(secret)
|
||||
|
|
|
@ -27,7 +27,7 @@ __license__ = "GPLv3"
|
|||
try:
|
||||
from stegano import steganalysisParity
|
||||
except:
|
||||
print "Install stegano: python setup.py install"
|
||||
print("Install Stegano: sudo pip install Stegano")
|
||||
|
||||
from PIL import Image
|
||||
|
||||
|
@ -43,4 +43,4 @@ parser.set_defaults(input_image_file = './pictures/Lenna.png',
|
|||
|
||||
input_image_file = Image.open(options.input_image_file)
|
||||
output_image = steganalysisParity.steganalyse(input_image_file)
|
||||
output_image.save(options.output_image_file)
|
||||
output_image.save(options.output_image_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue