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

video/tools/drawing.py local variable 'norm' referenced before assignment #1259

Closed
liikii opened this issue Jul 7, 2020 · 2 comments
Closed
Labels
bug Issues that report (apparent) bugs.

Comments

@liikii
Copy link

liikii commented Jul 7, 2020

There seems to be a bug

File "/home/debian2/anaconda3/lib/python3.7/site-packages/moviepy-2.0.0.dev1-py3.7.egg/moviepy/video/tools/drawing.py", line 156, in color_gradient
    n_vec = vector / norm ** 2  # norm 1/norm(vector)
UnboundLocalError: local variable 'norm' referenced before assignment
@liikii liikii added the bug Issues that report (apparent) bugs. label Jul 7, 2020
@tburrows13
Copy link
Collaborator

Thank you for the report. This is my fault: in #1101, the line if vector is not None: was incorrectly changed to if vector:, which caused #1205. Then I tried to fix it in #1212 but I apparently missed the not, so the logic is faulty. You can fix it in your installation by adding the not to that line: https://github.com/Zulko/moviepy/blob/master/moviepy/video/tools/drawing.py#L149

@tburrows13
Copy link
Collaborator

Fixed in ff15fcf

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

No branches or pull requests

2 participants