mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 11:16:14 +02:00
Add option to either pass a path or an Image instance
This commit is contained in:
parent
538316c722
commit
93de151025
5 changed files with 27 additions and 8 deletions
|
@ -42,7 +42,7 @@ def hide(input_image: Union[str, IO[bytes]],
|
|||
message_length = len(message)
|
||||
assert message_length != 0, "message length is zero"
|
||||
|
||||
img = Image.open(input_image)
|
||||
img = tools.open_image(input_image)
|
||||
|
||||
if img.mode not in ['RGB', 'RGBA']:
|
||||
if not auto_convert_rgb:
|
||||
|
@ -96,7 +96,7 @@ def hide(input_image: Union[str, IO[bytes]],
|
|||
def reveal(input_image: Union[str, IO[bytes]], encoding='UTF-8'):
|
||||
"""Find a message in an image (with the LSB technique).
|
||||
"""
|
||||
img = Image.open(input_image)
|
||||
img = tools.open_image(input_image)
|
||||
width, height = img.size
|
||||
buff, count = 0, 0
|
||||
bitab = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue