Skip to content

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

Description

@glennposadas

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
                }
            }
        })
    }
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions