Created
November 6, 2018 07:30
-
-
Save mabuak/8ac256fdd73e0702041cdf932e296d33 to your computer and use it in GitHub Desktop.
Fixed Image Orientation Swift 4.2
This file contains 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
// Fix Image Orientation | |
func fixImageOrientation(image:UIImage) -> UIImage | |
{ | |
UIGraphicsBeginImageContext(image.size) | |
image.draw(at: .zero) | |
let newImage = UIGraphicsGetImageFromCurrentImageContext() | |
UIGraphicsEndImageContext() | |
return newImage ?? image | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks broooo
Worked For meeeee