Fix handling of img_num=0 cases

This commit is contained in:
Steven Silvester
2015-05-09 09:32:33 -05:00
parent 883baa0328
commit ef9c4d8d19
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -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()
+1 -1
View File
@@ -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: