chg: [lsb] Added a parameter, close_file, to lsb.reveal in order to specify if the file must be closed at the end of the processing.

This commit is contained in:
Cédric Bonhomme 2024-09-07 23:51:47 +02:00
parent 80d7e6c88a
commit a6140fef36
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
3 changed files with 14 additions and 6 deletions

View file

@ -67,9 +67,10 @@ def reveal(
generator: Union[None, Iterator[int]] = None,
shift: int = 0,
encoding: str = "UTF-8",
close_file: bool = True,
):
"""Find a message in an image (with the LSB technique)."""
revealer = tools.Revealer(encoded_image, encoding)
revealer = tools.Revealer(encoded_image, encoding, close_file)
width = revealer.encoded_image.width
if not generator: