Compare commits

...

1 Commits

Author SHA1 Message Date
62e8afebb8 aspect ratio calc function 2024-06-24 22:34:51 -04:00

View File

@@ -605,6 +605,22 @@ GetDateOrdinalSuffix(D) {
} }
; Calculate the aspect ratio of a video/image using the width + height
getAspectRatio(width, height) {
gcd := gcdFunc(width, height)
return round(width/gcd) ":" round(height/gcd)
}
; The gcdFunc() is a helper function that calculates the GCD (greatest common divisor) of two numbers using the Euclidean algorithm.
; Used for calculating aspect ratio of Videos
gcdFunc(a, b) {
while b
t := b, b := Mod(a, b), a := t
return a
}
; OnMsgbox - Custom Msgbox Screens ; OnMsgbox - Custom Msgbox Screens