Skip to content

Commit

Permalink
Prefer files to sequence in later arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jan 6, 2019
1 parent 474a9ff commit 7141a75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pims/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ def open(sequence, **kwargs):
if len(files) > 1:
# todo: test if ImageSequence can read the image type,
# delegate to subclasses as needed
return ImageSequence(sequence, **kwargs)
return ImageSequence(files, **kwargs)

_, ext = os.path.splitext(sequence)
_, ext = os.path.splitext(files[0])
if ext is None or len(ext) < 2:
raise UnknownFormatError(
"Could not detect your file type because it did not have an "
Expand Down Expand Up @@ -207,7 +207,7 @@ def priority(cls):
exceptions = ''
for handler in sort_on_priority(eligible_handlers):
try:
return handler(sequence, **kwargs)
return handler(files[0], **kwargs)
except Exception as e:
message = '{0} errored: {1}'.format(str(handler), str(e))
warn(message)
Expand Down

0 comments on commit 7141a75

Please sign in to comment.