From a4a628b5292405ce40b9395bc961f87557ccd58e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 12 Dec 2014 09:38:48 -0600 Subject: [PATCH] Fix file indexing in ImageCollection --- skimage/io/collection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/io/collection.py b/skimage/io/collection.py index b7df8a3a..6a59b22c 100644 --- a/skimage/io/collection.py +++ b/skimage/io/collection.py @@ -210,12 +210,12 @@ class ImageCollection(object): else: i = 0 while True: - i += 1 - index.append((fname, i)) try: im.seek(i) except EOFError: break + index.append((fname, i)) + i += 1 if hasattr(im, 'fp') and im.fp: im.fp.close()