Skip to content

Commit

Permalink
Remove extraneous typing exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
ragibson committed Aug 16, 2024
1 parent f8d49e0 commit ef36718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions stego_lsb/LSBSteg.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def hide_message_in_image(input_image: Image.Image, message: Union[str, bytes],
log.debug(f"{f'{message_size} bytes hidden':<30} in {time() - start:.2f}s")

start = time()
# PIL expects a sequence of tuples, one per pixel TODO: this expression is too complicated for typing to handle?
input_image.putdata(cast(List[int], list(zip(*[iter(flattened_color_data)] * num_channels)))) # type: ignore
# PIL expects a sequence of tuples, one per pixel
input_image.putdata(cast(List[int], list(zip(*[iter(flattened_color_data)] * num_channels))))
log.debug(f"{'Image overwritten':<30} in {time() - start:.2f}s")
return input_image

Expand Down
3 changes: 1 addition & 2 deletions tests/test_lsbsteg.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
class TestLSBSteg(unittest.TestCase):
def write_random_image(self, filename: str, width: int, height: int, num_channels: int) -> None:
image_data = np.random.randint(0, 256, size=(height, width, num_channels), dtype=np.uint8)
# TODO: Image.fromarray() appears to have buggy typing?
with Image.fromarray(image_data) as image: # type: ignore
with Image.fromarray(image_data) as image:
image.save(filename)

def write_random_file(self, filename: str, num_bytes: int) -> None:
Expand Down

0 comments on commit ef36718

Please sign in to comment.