From b5a988a52fbd81e777c6f6fa737e802bd27d724a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 24 Oct 2014 16:30:56 -0500 Subject: [PATCH] Close the image file pointer when done. --- skimage/io/collection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/skimage/io/collection.py b/skimage/io/collection.py index 3f9e0890..4bf72ced 100644 --- a/skimage/io/collection.py +++ b/skimage/io/collection.py @@ -216,6 +216,9 @@ class ImageCollection(object): im.seek(i) except EOFError: break + if hasattr(im, 'fp') and im.fp: + im.fp.close() + self._frame_index = index return len(index)