mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Image.py: _conv_type_shape: refactor for clarity and type-safety.
This commit is contained in:
parent
470da1c6de
commit
58df924da6
|
@ -270,12 +270,11 @@ _MODE_CONV = {
|
|||
|
||||
|
||||
def _conv_type_shape(im):
|
||||
shape = im.size[1], im.size[0]
|
||||
typ, extra = _MODE_CONV[im.mode]
|
||||
if extra is None:
|
||||
return shape, typ
|
||||
return (im.size[1], im.size[0]), typ
|
||||
else:
|
||||
return shape+(extra,), typ
|
||||
return (im.size[1], im.size[0], extra), typ
|
||||
|
||||
|
||||
MODES = sorted(_MODEINFO)
|
||||
|
|
Loading…
Reference in New Issue
Block a user