Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageSequence broken on non-stack SPIDER image #1740

Closed
jmichalon opened this issue Feb 23, 2016 · 4 comments
Closed

ImageSequence broken on non-stack SPIDER image #1740

jmichalon opened this issue Feb 23, 2016 · 4 comments

Comments

@jmichalon
Copy link
Contributor

Using ImageSequence.Iterator on a non-stack SPIDER image leads to infinite loop. Looking into the code, EOFError is never raised because when the image isn't a stack, seek() returns gently without error.
This fixes the problem:

     def seek(self, frame):
         if self.istack == 0:
+            raise EOFError("attempt to seek in a non-stack file")
-            return
         if frame >= self._nimages:
             raise EOFError("attempt to seek past end of file")
@radarhere
Copy link
Member

Hey. Thanks for reporting this problem.

If you'd like, you can create the PR directly, so that your code can be reviewed by someone for acceptance into the project. If you have any problems with this, let us know, and maybe we can help.

The other thing that would be great is a test to repeat the error, so that this doesn't get re-introduced in the future.

@jmichalon
Copy link
Contributor Author

Here you are: #1741 :)
I've added a comment to the commit about a test case but with that memory thing I don't know how to handle…

@wiredfool
Copy link
Member

It looks like it's effectively a DOS, so we should probably just have the tests for it named Tests/check_spider_imagesequence.py

@wiredfool
Copy link
Member

Merged in #1794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants