mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06: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
|
@ -45,7 +45,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:
|
||||
|
@ -105,7 +105,7 @@ def reveal(input_image: Union[str, IO[bytes]],
|
|||
encoding: str = 'UTF-8'):
|
||||
"""Find a message in an image (with the LSB technique).
|
||||
"""
|
||||
img = Image.open(input_image)
|
||||
img = tools.open_image(input_image)
|
||||
img_list = list(img.getdata())
|
||||
width, height = img.size
|
||||
buff, count = 0, 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue