Skip to content

Commit

Permalink
Merge pull request #503 from scherroman/aspect_ratio_property
Browse files Browse the repository at this point in the history
Add aspect_ratio @Property to VideoClip
  • Loading branch information
Zulko authored Mar 20, 2017
2 parents 3b9bf7a + bcc2eb6 commit a2d0011
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions moviepy/video/VideoClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(self, make_frame=None, ismask=False, duration=None,
self.duration = duration
self.end = duration


@property
def w(self):
return self.size[0]
Expand All @@ -117,6 +118,11 @@ def h(self):
return self.size[1]


@property
def aspect_ratio(self):
return self.w / float(self.h)


# ===============================================================
# EXPORT OPERATIONS

Expand Down

0 comments on commit a2d0011

Please sign in to comment.