mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
chg: [type] Changed the way variables in some funtions are typed.
This commit is contained in:
parent
c12b371e7d
commit
bc9b91e983
1 changed files with 2 additions and 4 deletions
|
@ -1,6 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Stegano - Stegano is a pure Python steganography module.
|
# Stegano - Stegano is a pure Python steganography module.
|
||||||
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
|
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
|
||||||
#
|
#
|
||||||
|
@ -36,7 +34,7 @@ def steganalyse(img):
|
||||||
Steganlysis of the LSB technique.
|
Steganlysis of the LSB technique.
|
||||||
"""
|
"""
|
||||||
width, height = img.size
|
width, height = img.size
|
||||||
colours_counter = Counter() # type: typing.Counter[int]
|
colours_counter: typing.Counter[int] = Counter()
|
||||||
for row in range(height):
|
for row in range(height):
|
||||||
for col in range(width):
|
for col in range(width):
|
||||||
r, g, b = img.getpixel((col, row))
|
r, g, b = img.getpixel((col, row))
|
||||||
|
@ -47,7 +45,7 @@ def steganalyse(img):
|
||||||
sorted(list(colours_counter.items()), key=lambda t: t[1])
|
sorted(list(colours_counter.items()), key=lambda t: t[1])
|
||||||
)
|
)
|
||||||
|
|
||||||
colours = 0 # type: float
|
colours: float = 0
|
||||||
for colour in list(dict_colours.keys()):
|
for colour in list(dict_colours.keys()):
|
||||||
colours += colour
|
colours += colour
|
||||||
colours = colours / len(dict_colours)
|
colours = colours / len(dict_colours)
|
||||||
|
|
Loading…
Add table
Reference in a new issue