Created
October 21, 2019 05:44
-
-
Save trilliwon/98f90546126312ef2cd9d7257624bead to your computer and use it in GitHub Desktop.
CGAffineTransform.isPortrait.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CGAffineTransform { | |
// Check the video track's preferred transform to determine if it was recorded in portrait mode. | |
var isPortrait: Bool { | |
if self.a == 0 && self.d == 0 && (self.b == 1.0 || self.b == -1.0) && (self.c == 1.0 || self.c == -1.0) { | |
return true | |
} | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment