This repository was archived by the owner on Jun 23, 2020. It is now read-only.
Description Full code:
Repro steps:
App should let user to choose between photo library and camera as a source of the new image.
Select a photo with two faces that works 100% with BetterFace library from the Photo Library.
After seeing that BF works fine with the photo from the Photo Library, now select a new photo using the Camera as a source.
ImageView still has the old photo from the Photo Library.
Any ideas? I've been debugging this for an hour already.
extension VerificationViewController: UIPickerViewDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
picker.dismiss(animated: true, completion: {
if let newImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
let normalizedImage = newImage.normalizeImage()
self.imageView_ProfilePicture.needsBetterFace = true
self.imageView_ProfilePicture.fast = true
self.imageView_ProfilePicture.setBetterFaceImage(normalizedImage)
self.imageView_ProfilePicture.makeRoundCorners()
self.imageData = UIImageJPEGRepresentation(normalizedImage, 0.75)
UIView.animate(withDuration: 0.3) {
self.label_WarningUploadPhoto.isHidden = self.imageData != nil
}
}
})
}
}