Skip to content

Commit

Permalink
Add Pillow dependency via imageio, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervdw committed Jul 24, 2017
1 parent 35a110e commit d76002b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ sudo: false
matrix:
include:
- python: "2.7"
env: DEPS="numpy=1.8* slicerator tifffile" DEPSPIP="imageio" BUILD_DOCS=false
env: DEPS="numpy=1.8* slicerator pillow tifffile jinja2" DEPSPIP="imageio" BUILD_DOCS=false
- python: "2.7"
env: DEPS="numpy slicerator scipy pillow matplotlib scikit-image jinja2 av libtiff tifffile jpype1" DEPSPIP="moviepy imageio" BUILD_DOCS=false
- python: "3.6"
env: DEPS="numpy slicerator tifffile" DEPSPIP="imageio" BUILD_DOCS=false
env: DEPS="numpy slicerator pillow tifffile jinja2" DEPSPIP="imageio" BUILD_DOCS=false
- python: "3.6"
env: DEPS="numpy slicerator scipy pillow matplotlib scikit-image jinja2 av tifffile libtiff jpype1 ipython sphinx sphinx_rtd_theme numpydoc" DEPSPIP="moviepy imageio" BUILD_DOCS=true

Expand Down
8 changes: 7 additions & 1 deletion pims/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,11 @@ def setUp(self):
self.frame1 = np.load(os.path.join(path, 'bulk-water_frame1.npy'))
self.klass = pims.ImageIOReader
self.kwargs = dict()
self.v = self.klass(self.filename, **self.kwargs)
try:
self.v = self.klass(self.filename, **self.kwargs)
except imageio.core.fetching.NeedDownloadError:
imageio.plugins.ffmpeg.download()
self.v = self.klass(self.filename, **self.kwargs)
self.expected_shape = (424, 640, 3)
self.expected_len = 480

Expand Down Expand Up @@ -566,13 +570,15 @@ def setUp(self):
_skip_if_no_PIL()

def test_open_png(self):
_skip_if_no_imread()
self.filenames = ['dummy_png.png']
shape = (10, 11)
save_dummy_png(path, self.filenames, shape)
pims.open(os.path.join(path, 'dummy_png.png'))
clean_dummy_png(path, self.filenames)

def test_open_pngs(self):
_skip_if_no_imread()
self.filepath = os.path.join(path, 'image_sequence')
self.filenames = ['T76S3F00001.png', 'T76S3F00002.png',
'T76S3F00003.png', 'T76S3F00004.png',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
description="Python Image Sequence",
author="PIMS Contributors",
install_requires=['slicerator>=0.9.7', 'six>=1.8', 'numpy>=1.7',
'imageio'],
'pillow', 'imageio'],
author_email="dallan@pha.jhu.edu",
url="https://github.com/soft-matter/pims",
packages=['pims',
Expand Down

0 comments on commit d76002b

Please sign in to comment.