Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix color_gradient crash #1212

Merged
merged 2 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Blank frames at the end of clips [#210]
- Sometimes getting `IndexError: list index out of range` when using `concatenate_videoclips` [#646]
- Applying `resize` with a non-constant `newsize` to a clip with a mask would remove the mask [#1200]

- Using `color_gradient()` would crash with `ValueError: The truth value of an array with more than one element is ambiguous` [#1212]

## [v1.0.3](https://github.com/zulko/moviepy/tree/v1.0.3) (2020-05-07)

Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/tools/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def color_gradient(
vector = np.array(vector[::-1])
p2 = p1 + vector

if vector:
if vector is None:
norm = np.linalg.norm(vector)

M = np.dstack(np.meshgrid(range(w), range(h))[::-1]).astype(float)
Expand Down