Skip to content

Commit

Permalink
Merge pull request #165 from Dennovin/master
Browse files Browse the repository at this point in the history
set correct lastindex variable in mask_make_frame
  • Loading branch information
Zulko committed Apr 29, 2015
2 parents abca1ce + 76efda7 commit 166efcb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions moviepy/video/io/ImageSequenceClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,16 @@ def make_frame(t):
if with_mask and (imread(self.sequence[0]).shape[2]==4):

self.mask = VideoClip(ismask=True)
self.mask.lastindex = None
self.mask.lastimage = None

def mask_make_frame(t):

index = find_image_index(t)
if index != self.lastindex:
if index != self.mask.lastindex:
frame = imread(self.sequence[index])[:,:,3]
self.mask.lastimage = frame.astype(float)/255
self.mask.lastindex = index
self.mask.lastindex = index

return self.mask.lastimage

Expand Down

0 comments on commit 166efcb

Please sign in to comment.