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

color_gradient has "if vector" #1205

Closed
pinq- opened this issue May 29, 2020 · 4 comments · Fixed by #1212
Closed

color_gradient has "if vector" #1205

pinq- opened this issue May 29, 2020 · 4 comments · Fixed by #1212
Labels
bug Issues that report (apparent) bugs.

Comments

@pinq-
Copy link

pinq- commented May 29, 2020

half_mask = color_gradient((2000,2000),p1=(0,200), p2=(100,200))

Expected Behavior

make the color gradient

Actual Behavior

get error:

moviepy\video\tools\drawing.py", line 147, in color_gradient
    if vector:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Steps to Reproduce the Problem

Run half_mask = color_gradient((2000,2000),p1=(0,200), p2=(100,200)) line.

Specifications

  • Python Version: 3.6.5
  • Moviepy Version: 1.0.3
  • Platform Name: Windows
  • Platform Version: 10
@pinq- pinq- added the bug Issues that report (apparent) bugs. label May 29, 2020
@pinq- pinq- changed the title color_gradient has "if fail color_gradient has "if vector" May 29, 2020
@tburrows13
Copy link
Collaborator

Thanks for the report. I have successfully reproduced this error.

@tburrows13
Copy link
Collaborator

You should be able to fix it by editing the line if vector: to say if vector is not None:.

Let me know if this fixes it, and feel free to open a pull request with the change if you like. If not, I'll do it.

@pinq-
Copy link
Author

pinq- commented May 30, 2020

looks like that works. I don't know how to make pull request, so you can do it :)

@tburrows13
Copy link
Collaborator

Fixed in #1212 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants