Skip to content

Commit 7565fab

Browse files
committed
fix import guard
1 parent b85cce7 commit 7565fab

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

src/compas/utilities/images.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@
33
from __future__ import division
44

55
import os
6+
import compas
67

7-
try:
8+
if not compas.IPY:
89
import imageio
9-
except ImportError:
10-
pass
1110

1211

13-
__all__ = ['gif_from_images']
12+
__all__ = ["gif_from_images"]
1413

1514

16-
def gif_from_images(files,
17-
gif_path,
18-
fps=10,
19-
loop=0,
20-
reverse=False,
21-
pingpong=False,
22-
subrectangles=True,
23-
delete_files=False):
15+
def gif_from_images(
16+
files,
17+
gif_path,
18+
fps=10,
19+
loop=0,
20+
reverse=False,
21+
pingpong=False,
22+
subrectangles=True,
23+
delete_files=False,
24+
):
2425
"""Create an animated GIF from a series of images.
2526
2627
Parameters
@@ -49,11 +50,9 @@ def gif_from_images(files,
4950
files.reverse()
5051
if pingpong:
5152
files += files[::-1]
52-
with imageio.get_writer(gif_path,
53-
mode='I',
54-
fps=fps,
55-
loop=loop,
56-
subrectangles=subrectangles) as writer:
53+
with imageio.get_writer(
54+
gif_path, mode="I", fps=fps, loop=loop, subrectangles=subrectangles
55+
) as writer:
5756
for filename in files:
5857
image = imageio.imread(filename)
5958
writer.append_data(image)

0 commit comments

Comments
 (0)