mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-26 07:04:45 +03:00
Typing: Image.getextrema
This commit is contained in:
parent
9a0c10e10a
commit
2ce902a7f6
|
@ -1292,9 +1292,16 @@ class Image(object):
|
|||
|
||||
self.load()
|
||||
if self.im.bands > 1:
|
||||
extrema = []
|
||||
extrema = [] # type: List[Tuple[int,int]]
|
||||
# UNDONE typing:
|
||||
# We know that the extrema here is List[Tuple[int,int]]
|
||||
# but the method sig of getextrema mentions a float, but
|
||||
# we know that if it's a multiband image, it's got to be
|
||||
# int. Single band images could be either.
|
||||
# We could cast, but that's not going to work with py27 or
|
||||
# py34
|
||||
for i in range(self.im.bands):
|
||||
extrema.append(self.im.getband(i).getextrema())
|
||||
extrema.append(self.im.getband(i).getextrema()) # type: ignore
|
||||
return tuple(extrema)
|
||||
return self.im.getextrema()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user