soft-matter/pims

pims.open fails to open a folder containing a single image using a glob pattern

n-poulsen opened this issue · 0 comments

When attempting to open images in a folder as an ImageSequence, the module fails when there is a single image in the folder. I would expect the behavior to return an image sequence containing a single image.

Reproducing the issue with the data:

images/
  - img.png

Code:

glob_pattern = "images/*.png"
with pims.open(sfname) as imgs:
   ...

Stacktrace

File "pims/api.py", line 206, in open
    raise UnknownFormatError("All handlers returned exceptions:\n" + exceptions)
pims.api.UnknownFormatError: All handlers returned exceptions:
<class 'pims.image_reader.ImageReader'> errored: No such file: 'images/*.png'
<class 'pims.image_reader.ImageReaderND'> errored: No such file: 'images/*.png'
<class 'pims.imageio_reader.ImageIOReader'> errored: No such file: 'images/*.png'