mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06:14 +02:00
chg: [typing] Make Mypy Happy Again.
This commit is contained in:
parent
21004219fa
commit
18fd8a8a49
5 changed files with 43 additions and 21 deletions
|
@ -23,6 +23,8 @@ __date__ = "$Date: 2010/10/01 $"
|
|||
__revision__ = "$Date: 2019/06/06 $"
|
||||
__license__ = "GPLv3"
|
||||
|
||||
from typing import cast
|
||||
|
||||
from PIL import Image
|
||||
|
||||
|
||||
|
@ -34,7 +36,7 @@ def steganalyse(img: Image.Image) -> Image.Image:
|
|||
width, height = img.size
|
||||
for row in range(height):
|
||||
for col in range(width):
|
||||
if pixel := img.getpixel((col, row)):
|
||||
if pixel := cast(tuple[int, int, int], img.getpixel((col, row))):
|
||||
r, g, b = pixel[0:3]
|
||||
else:
|
||||
raise Exception("Error during steganlysis.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue