From 57a6e3796ce5456706d4cd07b24afa6b7d0cf831 Mon Sep 17 00:00:00 2001 From: Franco Zanardi Date: Sun, 18 Jan 2026 20:42:59 -0300 Subject: [PATCH 1/2] fix(subclip): we must create subclip using type(self), since AlphaVideoClip extends from VideoClip --- src/movielite/video/video_clip.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/movielite/video/video_clip.py b/src/movielite/video/video_clip.py index 6b01a88..2a65380 100644 --- a/src/movielite/video/video_clip.py +++ b/src/movielite/video/video_clip.py @@ -148,8 +148,7 @@ def subclip(self, start: float, end: float) -> Self: if start < 0 or end > self.duration or start >= end: raise ValueError(f"Invalid subclip range: ({start}, {end}) for clip duration {self.duration}") - # Create a new instance with adjusted timing - new_clip = self.__new__(VideoClip) + new_clip = self.__new__(type(self)) new_clip._path = self._path new_clip._fps = self._fps new_clip._size = self._size From 0b594a5f3e8bc15dad4a37c549a98bcb03fb94ff Mon Sep 17 00:00:00 2001 From: Franco Zanardi Date: Sun, 18 Jan 2026 20:44:58 -0300 Subject: [PATCH 2/2] docs(subclip): update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e6f948..956cbab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Playback speed control via `set_speed()` method for all clip types - Rotation support via `set_rotation()` method and `vfx.Rotation` effect +### Fixed + +- `AlphaVideoClip.subclip()` now correctly returns `AlphaVideoClip` instead of `VideoClip`, preserving transparency and loop behavior + ## [0.2.1] - 2025-11-15 ### Changed