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 90 degrees rotation #1335

Merged
merged 3 commits into from
Oct 8, 2020
Merged

Fix 90 degrees rotation #1335

merged 3 commits into from
Oct 8, 2020

Conversation

nicoeps
Copy link
Contributor

@nicoeps nicoeps commented Oct 7, 2020

Resolves #781 #990 #1042 #1126 #1278

Rotating clips by either 90 or 270 degrees throws an exception because axes don't match when transposing. The clips seem to contain a frame (particularly the second frame of the clip) that has two dimensions instead of three. These changes should fix this issue by checking the shape for each frame and setting the appropriate value for transposing.

# Code that demonstrates the bug
import moviepy.editor as mp
text_video = mp.TextClip("test", color="blue", fontsize=72)
text_video = text_video.rotate(90).set_duration(2)
text_video.write_videofile("test.mp4", fps=24)
  • I have provided code that clearly demonstrates the bug and that only works correctly when applying this fix
  • I have added suitable tests demonstrating a fixed bug or new/changed feature to the test suite in tests/
  • I have properly documented new or changed features in the documentation or in the docstrings
  • I have properly explained unusual or unexpected code in the comments around it
  • I have formatted my code using black -t py36

@coveralls
Copy link

coveralls commented Oct 7, 2020

Coverage Status

Coverage remained the same at 67.887% when pulling 44eb1bb on nicoeps:rotate into 4356fcd on Zulko:master.

@nicoeps nicoeps changed the title Fix 90 degree rotation Fix 90 degrees rotation Oct 7, 2020
@tburrows13
Copy link
Collaborator

tburrows13 commented Oct 8, 2020

This looks great, thank you so much! You can ignore the failed code format check, that's not your fault (unless you want to work out why it has stopped working for everybody!).

@tburrows13 tburrows13 added the bug-fix For PRs and issues solving bugs. label Oct 8, 2020
@tburrows13 tburrows13 added this to the Release v2.0.0 milestone Oct 8, 2020
@tburrows13 tburrows13 added the hacktoberfest-accepted For Hacktoberfest PRs. See https://hacktoberfest.digitalocean.com/faq label Oct 8, 2020
@tburrows13
Copy link
Collaborator

There was a merge conflict because I had just merged #1170 which I've now fixed.

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.

rotating ImageClip with mask sets wrong transpo
3 participants