Last active
August 4, 2021 11:58
-
-
Save varun04/884af4d11234d7e1895b9d3df72db791 to your computer and use it in GitHub Desktop.
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
| func frameSize(at index: Int, downsamplingLevel: DownSamplingLevel = .default) -> CGSize? { | |
| guard let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, index, imageSourceOptions(with: downsamplingLevel)) as? [CFString: Any] else { | |
| return nil | |
| } | |
| guard let width = properties[kCGImagePropertyPixelWidth] as? Int, let height = properties[kCGImagePropertyPixelHeight] as? Int else { | |
| return nil | |
| } | |
| return CGSize(width: width, height: height) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment