chg: [typing] Make Mypy Happy Again.

This commit is contained in:
Cédric Bonhomme 2025-06-22 12:03:30 +02:00
parent 21004219fa
commit 18fd8a8a49
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
5 changed files with 43 additions and 21 deletions

View file

@ -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.")