Skip to content

Instantly share code, notes, and snippets.

@trilliwon
Created October 21, 2019 05:44
Show Gist options
  • Save trilliwon/98f90546126312ef2cd9d7257624bead to your computer and use it in GitHub Desktop.
Save trilliwon/98f90546126312ef2cd9d7257624bead to your computer and use it in GitHub Desktop.
CGAffineTransform.isPortrait.swift
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