Created
August 29, 2019 04:57
-
-
Save trilliwon/b7c5026c7146a2f813730d0a2b00f97b to your computer and use it in GitHub Desktop.
AVAssetTrack.isPortrait
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