Skip to content

Instantly share code, notes, and snippets.

@mabuak
Created November 6, 2018 07:30
Show Gist options
  • Save mabuak/8ac256fdd73e0702041cdf932e296d33 to your computer and use it in GitHub Desktop.
Save mabuak/8ac256fdd73e0702041cdf932e296d33 to your computer and use it in GitHub Desktop.
Fixed Image Orientation Swift 4.2
// Fix Image Orientation
func fixImageOrientation(image:UIImage) -> UIImage
{
UIGraphicsBeginImageContext(image.size)
image.draw(at: .zero)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage ?? image
}
@JiteshBharadiya
Copy link

Thanks broooo
Worked For meeeee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment