Skip to content

Commit

Permalink
Remove a bounds check for subclipped
Browse files Browse the repository at this point in the history
Too strict, trips too often on little things
Better to be more permissive with out-of-bounds times.
  • Loading branch information
bzczb committed Feb 9, 2025
1 parent 5a1ce34 commit 539270b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions moviepy/Clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,12 @@ def subclipped(self, start_time=0, end_time=None):

if end_time is not None:
# Allow a slight tolerance to account for rounding errors
if (self.duration is not None) and (end_time - self.duration > 0.00000001):
raise ValueError(
"end_time (%.02f) " % end_time
+ "should be smaller or equal to the clip's "
+ "duration (%.02f)." % self.duration
)
# if (self.duration is not None) and (end_time - self.duration > 0.00000001):
# raise ValueError(
# "end_time (%.02f) " % end_time
# + "should be smaller or equal to the clip's "
# + "duration (%.02f)." % self.duration
# )

new_clip.duration = end_time - start_time
new_clip.end = new_clip.start + new_clip.duration
Expand Down

0 comments on commit 539270b

Please sign in to comment.