My code takes a photo. Then saves it with a masking effect applied on it. The only problem is it is being saved at a -90 from the way I took it a portrait photo orientation. All I want to do is take a photo in portrait and have the photo be saved with out the rotation applied to it.
[Saved Pic when Mask is applied][2]
[Mask][3]
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
let red = info[UIImagePickerControllerOriginalImage] as! UIImage
self.dismiss(animated: true)
//Sugguested Code
red.imageOrientation = UIDevice.current.orientation.imageOrientation
//
self.currentImageView?.image = red
let image = photo.image
let maskingImage = UIImage(named: "mask")
photo.image = maskImage(image: image!, mask: maskingImage!)
photo.autoresizingMask = [.flexibleWidth, .flexibleHeight, .flexibleBottomMargin, .flexibleRightMargin, .flexibleLeftMargin, .flexibleTopMargin]
photo.contentMode = .scaleAspectFit
photo.clipsToBounds = true
}