mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 23:38:16 +08:00
Fix handling of img_num=0 cases
This commit is contained in:
@@ -114,6 +114,9 @@ def pil_to_ndarray(im, dtype=None, img_num=None):
|
||||
frames.append(frame)
|
||||
i += 1
|
||||
|
||||
if img_num is not None:
|
||||
break
|
||||
|
||||
if hasattr(im, 'fp') and im.fp:
|
||||
im.fp.close()
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ class ImageCollection(object):
|
||||
kwargs = self.load_func_kwargs
|
||||
if self._frame_index:
|
||||
fname, img_num = self._frame_index[n]
|
||||
if img_num > 0:
|
||||
if img_num is not None:
|
||||
self.data[idx] = self.load_func(fname, img_num=img_num,
|
||||
**kwargs)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user