I have the following code to select an image from the library and then base64encode for future upload... image is selected and appears in app as I want... however in output I get this error
[discovery] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
and if I take the printed base64 code in output and use a webtool (https://www.base64decode.org/) to attempt to decode said info, to confirm it has worked, before I start to work on decoding in iOS later - it appears to be malformed ? I am assuming I am not correctly encoding the image still ?
@IBAction func selectImage(_ sender: AnyObject) {
selectImage.allowsEditing = true //2
selectImage.sourceType = .photoLibrary //3
present(selectImage, animated: true, completion: nil)//4
}
func imagePickerController(_ selectImage: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
let chosenImage = info[UIImagePickerControllerEditedImage] as! UIImage //2
profilePic.contentMode = .scaleAspectFit //3
profilePic.image = chosenImage //4
let quality = 1.0
base64String = (UIImageJPEGRepresentation(chosenImage, CGFloat(quality))?.base64EncodedString())!
print (base64String)
self.dismiss(animated: true, completion: nil) //5
}