Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Bug? ImageView doesn't change its image if new image is from Camera. #15

Open
glennposadas opened this issue Apr 17, 2017 · 0 comments
Open

Comments

@glennposadas
Copy link

glennposadas commented Apr 17, 2017

Full code:

Repro steps:

  1. App should let user to choose between photo library and camera as a source of the new image.
  2. Select a photo with two faces that works 100% with BetterFace library from the Photo Library.
  3. After seeing that BF works fine with the photo from the Photo Library, now select a new photo using the Camera as a source.
  4. 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
                }
            }
        })
    }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant