diff --git a/CHANGELOG.md b/CHANGELOG.md index 99c1ae95e..928647330 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,8 @@ Lots of method and parameter names have been changed. This will be explained bet ### Fixed - Fixed BitmapClip with fps != 1 not returning the correct frames or crashing [#1333] - Fixed `rotate` sometimes failing with `ValueError: axes don't match array` [#1335] -- Changed deprecated `tostring` method by `tobytes` in `video.io.gif_writers::write_gif` #1429 +- Fixed positioning error generating frames in `CompositeVideoClip` [\#1420](https://github.com/Zulko/moviepy/pull/1420) +- Changed deprecated `tostring` method by `tobytes` in `video.io.gif_writers::write_gif` [\#1429](https://github.com/Zulko/moviepy/pull/1429) ## [v2.0.0.dev2](https://github.com/zulko/moviepy/tree/v2.0.0.dev2) (2020-10-05) diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py index 8ee8f10be..62d907fe6 100644 --- a/moviepy/video/VideoClip.py +++ b/moviepy/video/VideoClip.py @@ -602,7 +602,7 @@ def blit_on(self, picture, t): on the given `picture`, the position of the clip being given by the clip's ``pos`` attribute. Meant for compositing. """ - hf, wf = picture.size + wf, hf = picture.size ct = t - self.start # clip time @@ -631,7 +631,7 @@ def blit_on(self, picture, t): else: im_mask = None - hi, wi = im_img.size + wi, hi = im_img.size # SET POSITION pos = self.pos(ct) diff --git a/moviepy/video/tools/drawing.py b/moviepy/video/tools/drawing.py index d86ff1586..59b150b12 100644 --- a/moviepy/video/tools/drawing.py +++ b/moviepy/video/tools/drawing.py @@ -12,13 +12,11 @@ def blit(im1, im2, pos=None, mask=None): ``mask`` if provided. """ if pos is None: - pos = [0, 0] - - xp, yp = pos - xp1 = max(0, xp) - yp1 = max(0, yp) - - im2.paste(im1, (xp1, yp1), mask) + pos = (0, 0) + else: + # Cast to tuple in case pos is not subscriptable. + pos = tuple(pos) + im2.paste(im1, pos, mask) return im2