Skip to content

Commit d76002b

Browse files
committed
Add Pillow dependency via imageio, fix tests
1 parent 35a110e commit d76002b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ sudo: false
44
matrix:
55
include:
66
- python: "2.7"
7-
env: DEPS="numpy=1.8* slicerator tifffile" DEPSPIP="imageio" BUILD_DOCS=false
7+
env: DEPS="numpy=1.8* slicerator pillow tifffile jinja2" DEPSPIP="imageio" BUILD_DOCS=false
88
- python: "2.7"
99
env: DEPS="numpy slicerator scipy pillow matplotlib scikit-image jinja2 av libtiff tifffile jpype1" DEPSPIP="moviepy imageio" BUILD_DOCS=false
1010
- python: "3.6"
11-
env: DEPS="numpy slicerator tifffile" DEPSPIP="imageio" BUILD_DOCS=false
11+
env: DEPS="numpy slicerator pillow tifffile jinja2" DEPSPIP="imageio" BUILD_DOCS=false
1212
- python: "3.6"
1313
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
1414

pims/tests/test_common.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,11 @@ def setUp(self):
448448
self.frame1 = np.load(os.path.join(path, 'bulk-water_frame1.npy'))
449449
self.klass = pims.ImageIOReader
450450
self.kwargs = dict()
451-
self.v = self.klass(self.filename, **self.kwargs)
451+
try:
452+
self.v = self.klass(self.filename, **self.kwargs)
453+
except imageio.core.fetching.NeedDownloadError:
454+
imageio.plugins.ffmpeg.download()
455+
self.v = self.klass(self.filename, **self.kwargs)
452456
self.expected_shape = (424, 640, 3)
453457
self.expected_len = 480
454458

@@ -566,13 +570,15 @@ def setUp(self):
566570
_skip_if_no_PIL()
567571

568572
def test_open_png(self):
573+
_skip_if_no_imread()
569574
self.filenames = ['dummy_png.png']
570575
shape = (10, 11)
571576
save_dummy_png(path, self.filenames, shape)
572577
pims.open(os.path.join(path, 'dummy_png.png'))
573578
clean_dummy_png(path, self.filenames)
574579

575580
def test_open_pngs(self):
581+
_skip_if_no_imread()
576582
self.filepath = os.path.join(path, 'image_sequence')
577583
self.filenames = ['T76S3F00001.png', 'T76S3F00002.png',
578584
'T76S3F00003.png', 'T76S3F00004.png',

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
description="Python Image Sequence",
2424
author="PIMS Contributors",
2525
install_requires=['slicerator>=0.9.7', 'six>=1.8', 'numpy>=1.7',
26-
'imageio'],
26+
'pillow', 'imageio'],
2727
author_email="dallan@pha.jhu.edu",
2828
url="https://github.com/soft-matter/pims",
2929
packages=['pims',

0 commit comments

Comments
 (0)