Skip to content

Commit 7141a75

Browse files
committed
Prefer files to sequence in later arguments
1 parent 474a9ff commit 7141a75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pims/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ def open(sequence, **kwargs):
172172
if len(files) > 1:
173173
# todo: test if ImageSequence can read the image type,
174174
# delegate to subclasses as needed
175-
return ImageSequence(sequence, **kwargs)
175+
return ImageSequence(files, **kwargs)
176176

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

0 commit comments

Comments
 (0)