dingle dongle i am tired
This commit is contained in:
parent
73edf81633
commit
6b83c0b8c4
5 changed files with 158 additions and 15 deletions
|
|
@ -6,4 +6,16 @@ module ClipsHelper
|
|||
Time.at(seconds.round).utc.strftime("%M:%S") #=> "01:00:00"
|
||||
end
|
||||
end
|
||||
|
||||
def get_video_aspect(video)
|
||||
if video.metadata["width"] and video.metadata["height"]
|
||||
width = video.metadata["width"].round
|
||||
height = video.metadata["height"].round
|
||||
common_fact = width.gcd(height)
|
||||
width_div = width / common_fact
|
||||
height_div = height / common_fact
|
||||
return "#{width_div}:#{height_div}"
|
||||
end
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue