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

Prevent exception when filename is given. #1201

Merged
merged 3 commits into from
May 30, 2020

Conversation

obiwankennedy
Copy link
Contributor

just a short fix, I have issue about textclip, so I fixed it for me, and make the fix available here. Perhaps, it is a logic error. I did not check that. but at least you know that there is something strange around this code when passing a filename argument.

My textCilp construction is:
txtclip = TextClip(filename="/home/user/path/to/where/i/want/{}".format(text),font="Inria-Sans",fontsize=150, color="white")

@coveralls
Copy link

coveralls commented May 24, 2020

Coverage Status

Coverage remained the same at 67.448% when pulling 12dbeaa on obiwankennedy:owk_filename_for_text into e8ce135 on Zulko:master.

@tburrows13 tburrows13 added the bug-fix For PRs and issues solving bugs. label May 29, 2020
@tburrows13
Copy link
Collaborator

Thanks for the fix. I'll get round to checking this properly soon.

@tburrows13
Copy link
Collaborator

tburrows13 commented May 30, 2020

Agreed, this is a logic error: If txt == None and temptxt is not provided, then it will crash (as you found). I can't work out why tempfilename would end up being None, but I think that it is a good idea to clean up regardless of logic earlier in the function.

It was introduced here: https://github.com/Zulko/moviepy/pull/1077/files?file-filters%5B%5D=.md#diff-d6e691a0e95fa49e49448058435572cbL147 without taking into consideration that vector can be a numpy array.

@tburrows13 tburrows13 merged commit 7203c4e into Zulko:master May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix For PRs and issues solving bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants