Skip to content

Commit

Permalink
fix: regression when loading data from zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jun 19, 2018
1 parent 75a3bb2 commit 8689a09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.2.1
- fix: regression when loading data from zip file
0.2.0
- drop support for Python 3.5
- fix: SeriesHdf5Qpimage blocked hdf5 file for reading
Expand Down
7 changes: 5 additions & 2 deletions qpformat/file_formats/single_tif_holo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import pathlib

import qpimage
from skimage.external import tifffile
Expand All @@ -12,7 +13,9 @@ class SingleTifHolo(SingleData):

@staticmethod
def _get_tif(path):
if not isinstance(path, str):
if isinstance(path, pathlib.Path):
path = str(path)
elif not isinstance(path, str):
# Seek open file zero to avoid error in tifffile:
# "ValueError: invalid TIFF file"
path.seek(0)
Expand All @@ -39,7 +42,7 @@ def verify(path):
"""
valid = False
try:
tf = SingleTifHolo._get_tif(str(path))
tf = SingleTifHolo._get_tif(path)
except (ValueError, IsADirectoryError):
pass
else:
Expand Down

0 comments on commit 8689a09

Please sign in to comment.