mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-25 16:20:33 +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):
|
def _conv_type_shape(im):
|
||||||
shape = im.size[1], im.size[0]
|
|
||||||
typ, extra = _MODE_CONV[im.mode]
|
typ, extra = _MODE_CONV[im.mode]
|
||||||
if extra is None:
|
if extra is None:
|
||||||
return shape, typ
|
return (im.size[1], im.size[0]), typ
|
||||||
else:
|
else:
|
||||||
return shape+(extra,), typ
|
return (im.size[1], im.size[0], extra), typ
|
||||||
|
|
||||||
|
|
||||||
MODES = sorted(_MODEINFO)
|
MODES = sorted(_MODEINFO)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user