@@ -129,7 +129,7 @@ def initialize(self, start_time=0):
129129 # to be read by self.read_frame().
130130 # Eg when self.pos is 1, the 2nd frame will be read next.
131131 self .pos = self .get_frame_number (start_time )
132- self .lastread = self .read_frame ()
132+ self .last_read = self .read_frame ()
133133
134134 def skip_frames (self , n = 1 ):
135135 """Reads and throws away n frames"""
@@ -144,7 +144,7 @@ def read_frame(self):
144144 """
145145 Reads the next frame from the file.
146146 Note that upon (re)initialization, the first frame will already have been read
147- and stored in ``self.lastread ``.
147+ and stored in ``self.last_read ``.
148148 """
149149 w , h = self .size
150150 nbytes = self .depth * w * h
@@ -219,13 +219,18 @@ def get_frame(self, t):
219219 elif (pos < self .pos ) or (pos > self .pos + 100 ):
220220 # We can't just skip forward to `pos` or it would take too long
221221 self .initialize (t )
222- return self .lastread
222+ return self .last_read
223223 else :
224224 # If pos == self.pos + 1, this line has no effect
225225 self .skip_frames (pos - self .pos - 1 )
226226 result = self .read_frame ()
227227 return result
228228
229+ @property
230+ def lastread (self ):
231+ """Alias of `self.last_read` for backwards compatibility with MoviePy 1.x."""
232+ return self .last_read
233+
229234 def get_frame_number (self , t ):
230235 """Helper method to return the frame number at time ``t``"""
231236 # I used this horrible '+0.00001' hack because sometimes due to numerical
0 commit comments