From f7e984662af742b8de26e3841838b43b8447a4cd Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 7 Dec 2014 22:02:27 -0600 Subject: [PATCH] Fix handling of imgnum --- skimage/io/_plugins/pil_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/io/_plugins/pil_plugin.py b/skimage/io/_plugins/pil_plugin.py index e8f302e8..42061057 100644 --- a/skimage/io/_plugins/pil_plugin.py +++ b/skimage/io/_plugins/pil_plugin.py @@ -52,7 +52,7 @@ def imread(fname, dtype=None, img_num=None, **kwargs): site = "http://pillow.readthedocs.org/en/latest/installation.html#external-libraries" raise ValueError('Could not load "%s"\nPlease see documentation at: %s' % (fname, site)) else: - return pil_to_ndarray(im, dtype=dtype) + return pil_to_ndarray(im, dtype=dtype, img_num=img_num) def pil_to_ndarray(im, dtype=None, img_num=None): @@ -72,7 +72,7 @@ def pil_to_ndarray(im, dtype=None, img_num=None): break # seeking must be done sequentially - if img_num and not i == img_num: + if not img_num is None and not i == img_num: i += 1 continue