@@ -686,10 +686,9 @@ class ImageMagickFileWriter(ImageMagickBase, FileMovieWriter):
686
686
687
687
# Taken directly from jakevdp's JSAnimation package at
688
688
# http://github.com/jakevdp/JSAnimation
689
- def _included_frames (paths , frame_format ):
690
- """paths should be a list of Paths"""
691
- return INCLUDED_FRAMES .format (Nframes = len (paths ),
692
- frame_dir = paths [0 ].parent ,
689
+ def _included_frames (frame_count , frame_format , frame_dir ):
690
+ return INCLUDED_FRAMES .format (Nframes = frame_count ,
691
+ frame_dir = frame_dir ,
693
692
frame_format = frame_format )
694
693
695
694
@@ -783,11 +782,13 @@ def finish(self):
783
782
if self .embed_frames :
784
783
fill_frames = _embedded_frames (self ._saved_frames ,
785
784
self .frame_format )
786
- Nframes = len (self ._saved_frames )
785
+ frame_count = len (self ._saved_frames )
787
786
else :
788
787
# temp names is filled by FileMovieWriter
789
- fill_frames = _included_frames (self ._temp_paths , self .frame_format )
790
- Nframes = len (self ._temp_paths )
788
+ frame_count = len (self ._temp_paths )
789
+ fill_frames = _included_frames (
790
+ frame_count , self .frame_format ,
791
+ self ._temp_paths [0 ].parent .relative_to (self .outfile .parent ))
791
792
mode_dict = dict (once_checked = '' ,
792
793
loop_checked = '' ,
793
794
reflect_checked = '' )
@@ -798,7 +799,7 @@ def finish(self):
798
799
with open (self .outfile , 'w' ) as of :
799
800
of .write (JS_INCLUDE + STYLE_INCLUDE )
800
801
of .write (DISPLAY_TEMPLATE .format (id = uuid .uuid4 ().hex ,
801
- Nframes = Nframes ,
802
+ Nframes = frame_count ,
802
803
fill_frames = fill_frames ,
803
804
interval = interval ,
804
805
** mode_dict ))
0 commit comments