mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
Clean comments.
This commit is contained in:
parent
518729cd31
commit
f922905d10
3 changed files with 6 additions and 14 deletions
|
@ -29,8 +29,7 @@ from PIL import Image
|
||||||
import piexif
|
import piexif
|
||||||
|
|
||||||
def hide(input_image_file, img_enc, secret_message = None, secret_file = None, img_format = None):
|
def hide(input_image_file, img_enc, secret_message = None, secret_file = None, img_format = None):
|
||||||
"""
|
"""Hide a message (string) in an image.
|
||||||
Hide a message (string) in an image.
|
|
||||||
"""
|
"""
|
||||||
from zlib import compress
|
from zlib import compress
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
@ -62,8 +61,7 @@ def hide(input_image_file, img_enc, secret_message = None, secret_file = None, i
|
||||||
|
|
||||||
|
|
||||||
def reveal(input_image_file):
|
def reveal(input_image_file):
|
||||||
"""
|
"""Find a message in an image.
|
||||||
Find a message in an image.
|
|
||||||
"""
|
"""
|
||||||
from base64 import b64decode
|
from base64 import b64decode
|
||||||
from zlib import decompress
|
from zlib import decompress
|
||||||
|
|
|
@ -36,8 +36,7 @@ except NameError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def hide(input_image_file, message, auto_convert_rgb=False):
|
def hide(input_image_file, message, auto_convert_rgb=False):
|
||||||
"""
|
"""Hide a message (string) in an image with the
|
||||||
Hide a message (string) in an image with the
|
|
||||||
LSB (Least Significant Bit) technique.
|
LSB (Least Significant Bit) technique.
|
||||||
"""
|
"""
|
||||||
message_length = len(message)
|
message_length = len(message)
|
||||||
|
@ -99,8 +98,7 @@ def hide(input_image_file, message, auto_convert_rgb=False):
|
||||||
return encoded
|
return encoded
|
||||||
|
|
||||||
def reveal(input_image_file):
|
def reveal(input_image_file):
|
||||||
"""
|
"""Find a message in an image
|
||||||
Find a message in an image
|
|
||||||
(with the LSB technique).
|
(with the LSB technique).
|
||||||
"""
|
"""
|
||||||
img = Image.open(input_image_file)
|
img = Image.open(input_image_file)
|
||||||
|
@ -134,8 +132,6 @@ def reveal(input_image_file):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def write(image, output_image_file):
|
def write(image, output_image_file):
|
||||||
"""
|
|
||||||
"""
|
|
||||||
try:
|
try:
|
||||||
image.save(output_image_file)
|
image.save(output_image_file)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -38,8 +38,7 @@ except NameError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def hide(input_image_file, message, generator, auto_convert_rgb=False):
|
def hide(input_image_file, message, generator, auto_convert_rgb=False):
|
||||||
"""
|
"""Hide a message (string) in an image with the
|
||||||
Hide a message (string) in an image with the
|
|
||||||
LSB (Least Significant Bit) technique.
|
LSB (Least Significant Bit) technique.
|
||||||
"""
|
"""
|
||||||
message_length = len(message)
|
message_length = len(message)
|
||||||
|
@ -98,8 +97,7 @@ def hide(input_image_file, message, generator, auto_convert_rgb=False):
|
||||||
|
|
||||||
|
|
||||||
def reveal(input_image_file, generator):
|
def reveal(input_image_file, generator):
|
||||||
"""
|
"""Find a message in an image
|
||||||
Find a message in an image
|
|
||||||
(with the LSB technique).
|
(with the LSB technique).
|
||||||
"""
|
"""
|
||||||
img = Image.open(input_image_file)
|
img = Image.open(input_image_file)
|
||||||
|
|
Loading…
Add table
Reference in a new issue