mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-03 13:11:25 +08:00
Fix handling of singleton frames in pil_to_ndarray
This commit is contained in:
@@ -112,10 +112,12 @@ def pil_to_ndarray(im, dtype=None, img_num=None):
|
||||
if hasattr(im, 'fp') and im.fp:
|
||||
im.fp.close()
|
||||
|
||||
if img_num is None:
|
||||
if img_num is None and len(frames) > 1:
|
||||
return np.array(frames)
|
||||
else:
|
||||
elif frames:
|
||||
return frames[0]
|
||||
elif img_num:
|
||||
raise IndexError('Could not find image #%s' % img_num)
|
||||
|
||||
|
||||
def _palette_is_grayscale(pil_image):
|
||||
|
||||
Reference in New Issue
Block a user